PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /home/wallqcyy/www/wp-content/plugins/woocommerce/assets/client/blocks/
Upload File :
Current File : /home/wallqcyy/www/wp-content/plugins/woocommerce/assets/client/blocks/product-best-sellers.js

(()=>{var e,t,r,s={9955:(e,t,r)=>{"use strict";var s=r(4530),o=r(4807);const i=window.wp.blocks,c=JSON.parse('{"name":"woocommerce/product-best-sellers","title":"Best Selling Products","category":"woocommerce","keywords":["WooCommerce"],"description":"Display a grid of your all-time best selling products.","supports":{"interactivity":{"clientNavigation":false},"align":["wide","full"],"html":false,"inserter":false},"attributes":{"columns":{"type":"number","default":3},"rows":{"type":"number","default":3},"alignButtons":{"type":"boolean","default":false},"contentVisibility":{"type":"object","default":{"image":true,"title":true,"price":true,"rating":true,"button":true},"properties":{"image":{"type":"boolean","default":true},"title":{"type":"boolean","default":true},"price":{"type":"boolean","default":true},"rating":{"type":"boolean","default":true},"button":{"type":"boolean","default":true}}},"categories":{"type":"array","default":[]},"catOperator":{"type":"string","default":"any"},"isPreview":{"type":"boolean","default":false},"stockStatus":{"type":"array"},"editMode":{"type":"boolean","default":true},"orderby":{"type":"string","enum":["date","popularity","price_asc","price_desc","rating","title","menu_order"],"default":"popularity"}},"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}'),n=window.wp.blockEditor,l=window.wp.components,a=window.wp.serverSideRender;var d=r.n(a),m=r(790);const h=(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"},children:[(0,m.jsx)("title",{children:"Grid Block Preview"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,m.jsx)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,m.jsx)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"})]});var u=r(7723);const x=(e,t,r)=>r?Math.min(e,t)===e?t:Math.max(e,r)===e?r:e:Math.max(e,t)===t?e:t,g=({columns:e,rows:t,setAttributes:r,alignButtons:s,minColumns:o=1,maxColumns:i=6,minRows:c=1,maxRows:n=6})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(l.RangeControl,{label:(0,u.__)("Columns","woocommerce"),value:e,onChange:e=>{const t=x(e,o,i);r({columns:Number.isNaN(t)?"":t})},min:o,max:i}),(0,m.jsx)(l.RangeControl,{label:(0,u.__)("Rows","woocommerce"),value:t,onChange:e=>{const t=x(e,c,n);r({rows:Number.isNaN(t)?"":t})},min:c,max:n}),(0,m.jsx)(l.ToggleControl,{label:(0,u.__)("Align the last block to the bottom","woocommerce"),help:s?(0,u.__)("Align the last block to the bottom.","woocommerce"):(0,u.__)("The last inner block will follow other content.","woocommerce"),checked:s,onChange:()=>r({alignButtons:!s})})]}),p=window.wc.wcSettings,w=({onChange:e,settings:t})=>{const{image:r,button:s,price:o,rating:i,title:c}=t,n=!1!==r;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(l.ToggleControl,{label:(0,u.__)("Product image","woocommerce"),checked:n,onChange:()=>e({...t,image:!n})}),(0,m.jsx)(l.ToggleControl,{label:(0,u.__)("Product title","woocommerce"),checked:c,onChange:()=>e({...t,title:!c})}),(0,m.jsx)(l.ToggleControl,{label:(0,u.__)("Product price","woocommerce"),checked:o,onChange:()=>e({...t,price:!o})}),(0,m.jsx)(l.ToggleControl,{label:(0,u.__)("Product rating","woocommerce"),checked:i,onChange:()=>e({...t,rating:!i})}),(0,m.jsx)(l.ToggleControl,{label:(0,u.__)("Add to Cart button","woocommerce"),checked:s,onChange:()=>e({...t,button:!s})})]})};var f=r(4921),E=r(6087);function j(e,t,r){const s=new Set(t.map((e=>e[r])));return e.filter((e=>!s.has(e[r])))}const b=window.wp.htmlEntities,y={clear:(0,u.__)("Clear all selected items","woocommerce"),noItems:(0,u.__)("No items found.","woocommerce"),
/* Translators: %s search term */
noResults:(0,u.__)("No results for %s","woocommerce"),search:(0,u.__)("Search for items","woocommerce"),selected:e=>(0,u.sprintf)(/* translators: Number of items selected from list. */ /* translators: Number of items selected from list. */
(0,u._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:(0,u.__)("Search results updated.","woocommerce")},_=(e,t=e)=>{const r=e.reduce(((e,t)=>{const r=t.parent||0;return e[r]||(e[r]=[]),e[r].push(t),e}),{}),s=t.reduce(((e,t)=>(e[String(t.id)]=t,e)),{});const o=["0"],i=(e={})=>e.parent?[...i(s[e.parent]),e.name]:e.name?[e.name]:[],c=e=>e.map((e=>{const t=r[e.id];return o.push(""+e.id),{...e,breadcrumbs:i(s[e.parent]),children:t&&t.length?c(t):[]}})),n=c(r[0]||[]);return Object.entries(r).forEach((([e,t])=>{o.includes(e)||n.push(...c(t||[]))})),n},v=(e,t)=>{if(!t)return e;const r=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(r).map(((e,t)=>r.test(e)?(0,m.jsx)("strong",{children:e},t):(0,m.jsx)(E.Fragment,{children:e},t)))},C=({label:e})=>(0,m.jsx)("span",{className:"woocommerce-search-list__item-count",children:e}),k=e=>{const{item:t,search:r}=e,s=t.breadcrumbs&&t.breadcrumbs.length;return(0,m.jsxs)("span",{className:"woocommerce-search-list__item-label",children:[s?(0,m.jsx)("span",{className:"woocommerce-search-list__item-prefix",children:(o=t.breadcrumbs,1===o.length?o.slice(0,1).toString():2===o.length?o.slice(0,1).toString()+" › "+o.slice(-1).toString():o.slice(0,1).toString()+" … "+o.slice(-1).toString())}):null,(0,m.jsx)("span",{className:"woocommerce-search-list__item-name",children:v((0,b.decodeEntities)(t.name),r)})]});var o},S=({countLabel:e,className:t,depth:r=0,controlId:s="",item:o,isSelected:i,isSingle:c,onSelect:n,search:a="",selected:d,useExpandedPanelId:h,...u})=>{const[x,g]=h,p=null!=e&&void 0!==o.count&&null!==o.count,w=!!o.breadcrumbs?.length,y=!!o.children?.length,_=x===o.id,S=(0,f.A)(["woocommerce-search-list__item",`depth-${r}`,t],{"has-breadcrumbs":w,"has-children":y,"has-count":p,"is-expanded":_,"is-radio-button":c});(0,E.useEffect)((()=>{y&&i&&g(o.id)}),[o,y,i,g]);const N=u.name||`search-list-item-${s}`,O=`${N}-${o.id}`,P=(0,E.useCallback)((()=>{g(_?-1:Number(o.id))}),[_,o.id,g]);return y?(0,m.jsx)("div",{className:S,onClick:P,onKeyDown:e=>"Enter"===e.key||" "===e.key?P():null,role:"treeitem",tabIndex:0,children:c?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("input",{type:"radio",id:O,name:N,value:o.value,onChange:n(o),onClick:e=>e.stopPropagation(),checked:i,className:"woocommerce-search-list__item-input",...u}),(0,m.jsx)(k,{item:o,search:a}),p?(0,m.jsx)(C,{label:e||o.count}):null]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(l.CheckboxControl,{className:"woocommerce-search-list__item-input",checked:i,...!i&&o.children.some((e=>d.find((t=>t.id===e.id))))?{indeterminate:!0}:{},label:v((0,b.decodeEntities)(o.name),a),onChange:()=>{i?n(j(d,o.children,"id"))():n(function(e,t){const r=j(t,e,"id");return[...e,...r]}(d,o.children))()},onClick:e=>e.stopPropagation()}),p?(0,m.jsx)(C,{label:e||o.count}):null]})}):(0,m.jsxs)("label",{htmlFor:O,className:S,children:[c?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("input",{...u,type:"radio",id:O,name:N,value:o.value,onChange:n(o),checked:i,className:"woocommerce-search-list__item-input"}),(0,m.jsx)(k,{item:o,search:a})]}):(0,m.jsx)(l.CheckboxControl,{...u,id:O,name:N,className:"woocommerce-search-list__item-input",value:(0,b.decodeEntities)(o.value),label:v((0,b.decodeEntities)(o.name),a),onChange:n(o),checked:i}),p?(0,m.jsx)(C,{label:e||o.count}):null]})},N=S;var O=r(2624),P=r(9491),I=r(3028);r(5022);const R=({id:e,label:t,popoverContents:r,remove:o,screenReaderLabel:i,className:c=""})=>{const[n,a]=(0,E.useState)(!1),d=(0,P.useInstanceId)(R);if(i=i||t,!t)return null;t=(0,b.decodeEntities)(t);const h=(0,f.A)("woocommerce-tag",c,{"has-remove":!!o}),x=`woocommerce-tag__label-${d}`,g=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("span",{className:"screen-reader-text",children:i}),(0,m.jsx)("span",{"aria-hidden":"true",children:t})]});return(0,m.jsxs)("span",{className:h,children:[r?(0,m.jsx)(l.Button,{className:"woocommerce-tag__text",id:x,onClick:()=>a(!0),children:g}):(0,m.jsx)("span",{className:"woocommerce-tag__text",id:x,children:g}),r&&n&&(0,m.jsx)(l.Popover,{onClose:()=>a(!1),children:r}),o&&(0,m.jsx)(l.Button,{className:"woocommerce-tag__remove",onClick:o(e),label:(0,u.sprintf)(
// Translators: %s label.
// Translators: %s label.
(0,u.__)("Remove %s","woocommerce"),t),"aria-describedby":x,children:(0,m.jsx)(s.A,{icon:I.A,size:20,className:"clear-icon",role:"img"})})]})},A=R;r(1939);const B=e=>(0,m.jsx)(N,{...e}),$=e=>{const{list:t,selected:r,renderItem:s,depth:o=0,onSelect:i,instanceId:c,isSingle:n,search:l,useExpandedPanelId:a}=e,[d]=a;return t?(0,m.jsx)(m.Fragment,{children:t.map((t=>{const h=t.children?.length&&!n?t.children.every((({id:e})=>r.find((t=>t.id===e)))):!!r.find((({id:e})=>e===t.id)),u=t.children?.length&&d===t.id;return(0,m.jsxs)(E.Fragment,{children:[(0,m.jsx)("li",{children:s({item:t,isSelected:h,onSelect:i,isSingle:n,selected:r,search:l,depth:o,useExpandedPanelId:a,controlId:c})}),u?(0,m.jsx)($,{...e,list:t.children,depth:o+1}):null]},t.id)}))}):null},T=({isLoading:e,isSingle:t,selected:r,messages:s,onChange:o,onRemove:i})=>{if(e||t||!r)return null;const c=r.length;return(0,m.jsxs)("div",{className:"woocommerce-search-list__selected",children:[(0,m.jsxs)("div",{className:"woocommerce-search-list__selected-header",children:[(0,m.jsx)("strong",{children:s.selected(c)}),c>0?(0,m.jsx)(l.Button,{variant:"link",isDestructive:!0,onClick:()=>o([]),"aria-label":s.clear,children:(0,u.__)("Clear all","woocommerce")}):null]}),c>0?(0,m.jsx)("ul",{children:r.map(((e,t)=>(0,m.jsx)("li",{children:(0,m.jsx)(A,{label:e.name,id:e.id,remove:i})},t)))}):null]})},F=({filteredList:e,search:t,onSelect:r,instanceId:o,useExpandedPanelId:i,...c})=>{const{messages:n,renderItem:l,selected:a,isSingle:d}=c,h=l||B;return 0===e.length?(0,m.jsxs)("div",{className:"woocommerce-search-list__list is-not-found",children:[(0,m.jsx)("span",{className:"woocommerce-search-list__not-found-icon",children:(0,m.jsx)(s.A,{icon:O.A,role:"img"})}),(0,m.jsx)("span",{className:"woocommerce-search-list__not-found-text",children:t?(0,u.sprintf)(n.noResults,t):n.noItems})]}):(0,m.jsx)("ul",{className:"woocommerce-search-list__list",children:(0,m.jsx)($,{useExpandedPanelId:i,list:e,selected:a,renderItem:h,onSelect:r,instanceId:o,isSingle:d,search:t})})},M=e=>{const{className:t="",isCompact:r,isHierarchical:s,isLoading:o,isSingle:i,list:c,messages:n=y,onChange:a,onSearch:d,selected:h,type:x="text",debouncedSpeak:g}=e,[p,w]=(0,E.useState)(""),j=(0,E.useState)(-1),b=(0,P.useInstanceId)(M),v=(0,E.useMemo)((()=>({...y,...n})),[n]),C=(0,E.useMemo)((()=>((e,t,r)=>{if(!t)return r?_(e):e;const s=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),o=e.map((e=>!!s.test(e.name)&&e)).filter(Boolean);return r?_(o,e):o})(c,p,s)),[c,p,s]);(0,E.useEffect)((()=>{g&&g(v.updated)}),[g,v]),(0,E.useEffect)((()=>{"function"==typeof d&&d(p)}),[p,d]);const k=(0,E.useCallback)((e=>()=>{i&&a([]);const t=h.findIndex((({id:t})=>t===e));a([...h.slice(0,t),...h.slice(t+1)])}),[i,h,a]),S=(0,E.useCallback)((e=>()=>{Array.isArray(e)?a(e):-1===h.findIndex((({id:t})=>t===e.id))?a(i?[e]:[...h,e]):k(e.id)()}),[i,k,a,h]),N=(0,E.useCallback)((e=>{const[t]=h.filter((t=>!e.find((e=>t.id===e.id))));k(t.id)()}),[k,h]);return(0,m.jsxs)("div",{className:(0,f.A)("woocommerce-search-list",t,{"is-compact":r,"is-loading":o,"is-token":"token"===x}),children:["text"===x&&(0,m.jsx)(T,{...e,onRemove:k,messages:v}),(0,m.jsx)("div",{className:"woocommerce-search-list__search",children:"text"===x?(0,m.jsx)(l.TextControl,{label:v.search,type:"search",value:p,onChange:e=>w(e)}):(0,m.jsx)(l.FormTokenField,{disabled:o,label:v.search,onChange:N,onInputChange:e=>w(e),suggestions:[],__experimentalValidateInput:()=>!1,value:o?[(0,u.__)("Loading…","woocommerce")]:h.map((e=>({...e,value:e.name}))),__experimentalShowHowTo:!1})}),o?(0,m.jsx)("div",{className:"woocommerce-search-list__list",children:(0,m.jsx)(l.Spinner,{})}):(0,m.jsx)(F,{...e,search:p,filteredList:C,messages:v,onSelect:S,instanceId:b,useExpandedPanelId:j})]})},L=((0,l.withSpokenMessages)(M),window.wp.url),H=window.wp.apiFetch;var V=r.n(H);const D=window.wp.escapeHtml,J=({message:e,type:t})=>e?"general"===t?(0,m.jsxs)("span",{children:[(0,u.__)("The following error was returned","woocommerce"),(0,m.jsx)("br",{}),(0,m.jsx)("code",{children:(0,D.escapeHTML)(e)})]}):"api"===t?(0,m.jsxs)("span",{children:[(0,u.__)("The following error was returned from the API","woocommerce"),(0,m.jsx)("br",{}),(0,m.jsx)("code",{children:(0,D.escapeHTML)(e)})]}):e:(0,u.__)("An error has prevented the block from being updated.","woocommerce"),W=({error:e})=>(0,m.jsx)("div",{className:"wc-block-error-message",children:J(e)}),z=e=>{const{id:t,name:r,parent:s,count:o}=e;return{id:t,name:r,parent:s,count:o,breadcrumbs:[],children:[],details:e,value:e.slug}};r(6982);const G=(Y=({categories:e=[],error:t=null,isLoading:r=!1,onChange:s,onOperatorChange:o,operator:i="any",selected:c,isCompact:n=!1,isSingle:a=!1,showReviewCount:d})=>{const h={clear:(0,u.__)("Clear all product categories","woocommerce"),list:(0,u.__)("Product Categories","woocommerce"),noItems:(0,u.__)("Your store doesn't have any product categories.","woocommerce"),search:(0,u.__)("Search for product categories","woocommerce"),selected:e=>(0,u.sprintf)(/* translators: %d is the count of selected categories. */ /* translators: %d is the count of selected categories. */
(0,u._n)("%d category selected","%d categories selected",e,"woocommerce"),e),updated:(0,u.__)("Category search results updated.","woocommerce")};if(t)return(0,m.jsx)(W,{error:t});const x=e.map(z);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(M,{className:"woocommerce-product-categories",list:x,isLoading:r,selected:x.filter((({id:e})=>c.includes(Number(e)))),onChange:s,renderItem:e=>{const{item:t,search:r,depth:s=0}=e,o=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,i=d?(0,u.sprintf)(/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ /* translators: %1$s is the item name, %2$d is the count of reviews for the item. */
(0,u._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.details?.review_count||0,"woocommerce"),o,t.details?.review_count||0):(0,u.sprintf)(/* translators: %1$s is the item name, %2$d is the count of products for the item. */ /* translators: %1$s is the item name, %2$d is the count of products for the item. */
(0,u._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.details?.count||0,"woocommerce"),o,t.details?.count||0),c=d?(0,u.sprintf)(/* translators: %d is the count of reviews. */ /* translators: %d is the count of reviews. */
(0,u._n)("%d review","%d reviews",t.details?.review_count||0,"woocommerce"),t.details?.review_count||0):(0,u.sprintf)(/* translators: %d is the count of products. */ /* translators: %d is the count of products. */
(0,u._n)("%d product","%d products",t.details?.count||0,"woocommerce"),t.details?.count||0);return(0,m.jsx)(S,{className:(0,f.A)("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===s&&0!==t.parent}),...e,countLabel:c,"aria-label":i})},messages:h,isCompact:n,isHierarchical:!0,isSingle:a}),!!o&&(0,m.jsx)("div",{hidden:c.length<2,children:(0,m.jsx)(l.SelectControl,{className:"woocommerce-product-categories__operator",label:(0,u.__)("Display products matching","woocommerce"),help:(0,u.__)("Pick at least two categories to use this setting.","woocommerce"),value:i,onChange:o,options:[{label:(0,u.__)("Any selected categories","woocommerce"),value:"any"},{label:(0,u.__)("All selected categories","woocommerce"),value:"all"}]})})]})},({selected:e,...t})=>{const[r,s]=(0,E.useState)(!0),[o,i]=(0,E.useState)(null),[c,n]=(0,E.useState)([]),l=async e=>{const t=await(async e=>{if(!("json"in e))return{code:e.code||"",message:e.message,type:e.type||"general"};try{const t=await e.json();return{code:t.code||"",message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}})(e);i(t),s(!1)},a=(0,E.useRef)(e);return(0,E.useEffect)((()=>{var e;(e={selected:a.current},V()({path:(0,L.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})})).then((e=>{n(e),s(!1)})).catch(l)}),[a]),(0,m.jsx)(Y,{...t,selected:e,error:o,categories:c,isLoading:r})}),K=e=>{const{attributes:t,setAttributes:r}=e,{categories:s,catOperator:o,columns:i,contentVisibility:c,rows:a,alignButtons:d}=t;return(0,m.jsxs)(n.InspectorControls,{children:[(0,m.jsx)(l.PanelBody,{title:(0,u.__)("Layout","woocommerce"),initialOpen:!0,children:(0,m.jsx)(g,{columns:i,rows:a,alignButtons:d,setAttributes:r,minColumns:(0,p.getSetting)("minColumns",1),maxColumns:(0,p.getSetting)("maxColumns",6),minRows:(0,p.getSetting)("minRows",1),maxRows:(0,p.getSetting)("maxRows",6)})}),(0,m.jsx)(l.PanelBody,{title:(0,u.__)("Content","woocommerce"),initialOpen:!0,children:(0,m.jsx)(w,{settings:c,onChange:e=>r({contentVisibility:e})})}),(0,m.jsx)(l.PanelBody,{title:(0,u.__)("Filter by Product Category","woocommerce"),initialOpen:!1,children:(0,m.jsx)(G,{selected:s,onChange:(e=[])=>{const t=e.map((({id:e})=>e));r({categories:t})},operator:o,onOperatorChange:(e="any")=>r({catOperator:e})})})]},"inspector")},Q=e=>{const{attributes:t,name:r}=e;return t.isPreview?h:(0,m.jsxs)("div",{className:"wc-block-product-best-sellers",children:[(0,m.jsx)(K,{...e}),(0,m.jsx)(l.Disabled,{children:(0,m.jsx)(d(),{block:r,attributes:t})})]})},X={columns:{type:"number",default:(0,p.getSetting)("defaultColumns",3)},rows:{type:"number",default:(0,p.getSetting)("defaultRows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{image:!0,title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1},stockStatus:{type:"array",default:Object.keys((0,p.getSetting)("stockStatusOptions",[]))}};var Y;(0,i.registerBlockType)(c,{icon:{src:(0,m.jsx)(s.A,{icon:o.A,className:"wc-block-editor-components-block-icon"})},attributes:{...X,...c.attributes},transforms:{from:[{type:"block",blocks:["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"].filter((e=>"woocommerce/product-best-sellers"!==e)),transform:e=>(0,i.createBlock)("woocommerce/product-best-sellers",e)}]},edit:e=>{const t=(0,n.useBlockProps)();return(0,m.jsx)("div",{...t,children:(0,m.jsx)(Q,{...e})})},save:()=>null})},6982:()=>{},1939:()=>{},5022:()=>{},1609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},9491:e=>{"use strict";e.exports=window.wp.compose},6087:e=>{"use strict";e.exports=window.wp.element},7723:e=>{"use strict";e.exports=window.wp.i18n},5573:e=>{"use strict";e.exports=window.wp.primitives}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return s[e].call(r.exports,r,r.exports,i),r.exports}i.m=s,e=[],i.O=(t,r,s,o)=>{if(!r){var c=1/0;for(d=0;d<e.length;d++){for(var[r,s,o]=e[d],n=!0,l=0;l<r.length;l++)(!1&o||c>=o)&&Object.keys(i.O).every((e=>i.O[e](r[l])))?r.splice(l--,1):(n=!1,o<c&&(c=o));if(n){e.splice(d--,1);var a=s();void 0!==a&&(t=a)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[r,s,o]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,s){if(1&s&&(e=this(e)),8&s)return e;if("object"==typeof e&&e){if(4&s&&e.__esModule)return e;if(16&s&&"function"==typeof e.then)return e}var o=Object.create(null);i.r(o);var c={};t=t||[null,r({}),r([]),r(r)];for(var n=2&s&&e;"object"==typeof n&&!~t.indexOf(n);n=r(n))Object.getOwnPropertyNames(n).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,i.d(o,c),o},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=2272,(()=>{var e={2272:0};i.O.j=t=>0===e[t];var t=(t,r)=>{var s,o,[c,n,l]=r,a=0;if(c.some((t=>0!==e[t]))){for(s in n)i.o(n,s)&&(i.m[s]=n[s]);if(l)var d=l(i)}for(t&&t(r);a<c.length;a++)o=c[a],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return i.O(d)},r=globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var c=i.O(void 0,[94],(()=>i(9955)));c=i.O(c),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["product-best-sellers"]=c})();

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic