uawdijnntqw1x1x1
IP : 216.73.216.109
Hostname : premium160.web-hosting.com
Kernel : Linux premium160.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
batcwwjx
/
www
/
wp-content
/
plugins
/
woocommerce
/
assets
/
client
/
blocks
/
product-tag.js
/
/
(()=>{var e,t,s,o={885:(e,t,s)=>{"use strict";const o=window.wp.blocks,r=window.wc.wcSettings;var c=s(4530),i=s(1686);const l=JSON.parse('{"name":"woocommerce/product-tag","title":"Products by Tag","category":"woocommerce","keywords":["WooCommerce"],"description":"Display a grid of products with selected tags.","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}}},"tags":{"type":"array","default":[]},"tagOperator":{"type":"string","default":"any"},"orderby":{"type":"string","default":"date"},"isPreview":{"type":"boolean","default":false},"stockStatus":{"type":"array"}},"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}'),n=window.wp.blockEditor,a=window.wp.serverSideRender;var d=s.n(a),h=s(7723);const m=window.wp.components;var u=s(6087),g=s(790);const x=({onChange:e,settings:t})=>{const{image:s,button:o,price:r,rating:c,title:i}=t,l=!1!==s;return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(m.ToggleControl,{label:(0,h.__)("Product image","woocommerce"),checked:l,onChange:()=>e({...t,image:!l})}),(0,g.jsx)(m.ToggleControl,{label:(0,h.__)("Product title","woocommerce"),checked:i,onChange:()=>e({...t,title:!i})}),(0,g.jsx)(m.ToggleControl,{label:(0,h.__)("Product price","woocommerce"),checked:r,onChange:()=>e({...t,price:!r})}),(0,g.jsx)(m.ToggleControl,{label:(0,h.__)("Product rating","woocommerce"),checked:c,onChange:()=>e({...t,rating:!c})}),(0,g.jsx)(m.ToggleControl,{label:(0,h.__)("Add to Cart button","woocommerce"),checked:o,onChange:()=>e({...t,button:!o})})]})},p=(e,t,s)=>s?Math.min(e,t)===e?t:Math.max(e,s)===e?s:e:Math.max(e,t)===t?e:t,w=({columns:e,rows:t,setAttributes:s,alignButtons:o,minColumns:r=1,maxColumns:c=6,minRows:i=1,maxRows:l=6})=>(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(m.RangeControl,{label:(0,h.__)("Columns","woocommerce"),value:e,onChange:e=>{const t=p(e,r,c);s({columns:Number.isNaN(t)?"":t})},min:r,max:c}),(0,g.jsx)(m.RangeControl,{label:(0,h.__)("Rows","woocommerce"),value:t,onChange:e=>{const t=p(e,i,l);s({rows:Number.isNaN(t)?"":t})},min:i,max:l}),(0,g.jsx)(m.ToggleControl,{label:(0,h.__)("Align the last block to the bottom","woocommerce"),help:o?(0,h.__)("Align the last block to the bottom.","woocommerce"):(0,h.__)("The last inner block will follow other content.","woocommerce"),checked:o,onChange:()=>s({alignButtons:!o})})]});var b=s(2624),_=s(4921),f=s(9491);const j={clear:(0,h.__)("Clear all selected items","woocommerce"),noItems:(0,h.__)("No items found.","woocommerce"), /* Translators: %s search term */ noResults:(0,h.__)("No results for %s","woocommerce"),search:(0,h.__)("Search for items","woocommerce"),selected:e=>(0,h.sprintf)(/* translators: Number of items selected from list. */ /* translators: Number of items selected from list. */ (0,h._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:(0,h.__)("Search results updated.","woocommerce")},E=(e,t=e)=>{const s=e.reduce(((e,t)=>{const s=t.parent||0;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),o=t.reduce(((e,t)=>(e[String(t.id)]=t,e)),{});const r=["0"],c=(e={})=>e.parent?[...c(o[e.parent]),e.name]:e.name?[e.name]:[],i=e=>e.map((e=>{const t=s[e.id];return r.push(""+e.id),{...e,breadcrumbs:c(o[e.parent]),children:t&&t.length?i(t):[]}})),l=i(s[0]||[]);return Object.entries(s).forEach((([e,t])=>{r.includes(e)||l.push(...i(t||[]))})),l},y=(e,t)=>{if(!t)return e;const s=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(s).map(((e,t)=>s.test(e)?(0,g.jsx)("strong",{children:e},t):(0,g.jsx)(u.Fragment,{children:e},t)))};function v(e,t,s){const o=new Set(t.map((e=>e[s])));return e.filter((e=>!o.has(e[s])))}const k=window.wp.htmlEntities,C=({label:e})=>(0,g.jsx)("span",{className:"woocommerce-search-list__item-count",children:e}),S=e=>{const{item:t,search:s}=e,o=t.breadcrumbs&&t.breadcrumbs.length;return(0,g.jsxs)("span",{className:"woocommerce-search-list__item-label",children:[o?(0,g.jsx)("span",{className:"woocommerce-search-list__item-prefix",children:(r=t.breadcrumbs,1===r.length?r.slice(0,1).toString():2===r.length?r.slice(0,1).toString()+" › "+r.slice(-1).toString():r.slice(0,1).toString()+" … "+r.slice(-1).toString())}):null,(0,g.jsx)("span",{className:"woocommerce-search-list__item-name",children:y((0,k.decodeEntities)(t.name),s)})]});var r},N=({countLabel:e,className:t,depth:s=0,controlId:o="",item:r,isSelected:c,isSingle:i,onSelect:l,search:n="",selected:a,useExpandedPanelId:d,...h})=>{const[x,p]=d,w=null!=e&&void 0!==r.count&&null!==r.count,b=!!r.breadcrumbs?.length,f=!!r.children?.length,j=x===r.id,E=(0,_.A)(["woocommerce-search-list__item",`depth-${s}`,t],{"has-breadcrumbs":b,"has-children":f,"has-count":w,"is-expanded":j,"is-radio-button":i});(0,u.useEffect)((()=>{f&&c&&p(r.id)}),[r,f,c,p]);const N=h.name||`search-list-item-${o}`,O=`${N}-${r.id}`,P=(0,u.useCallback)((()=>{p(j?-1:Number(r.id))}),[j,r.id,p]);return f?(0,g.jsx)("div",{className:E,onClick:P,onKeyDown:e=>"Enter"===e.key||" "===e.key?P():null,role:"treeitem",tabIndex:0,children:i?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("input",{type:"radio",id:O,name:N,value:r.value,onChange:l(r),onClick:e=>e.stopPropagation(),checked:c,className:"woocommerce-search-list__item-input",...h}),(0,g.jsx)(S,{item:r,search:n}),w?(0,g.jsx)(C,{label:e||r.count}):null]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(m.CheckboxControl,{className:"woocommerce-search-list__item-input",checked:c,...!c&&r.children.some((e=>a.find((t=>t.id===e.id))))?{indeterminate:!0}:{},label:y((0,k.decodeEntities)(r.name),n),onChange:()=>{c?l(v(a,r.children,"id"))():l(function(e,t){const s=v(t,e,"id");return[...e,...s]}(a,r.children))()},onClick:e=>e.stopPropagation()}),w?(0,g.jsx)(C,{label:e||r.count}):null]})}):(0,g.jsxs)("label",{htmlFor:O,className:E,children:[i?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("input",{...h,type:"radio",id:O,name:N,value:r.value,onChange:l(r),checked:c,className:"woocommerce-search-list__item-input"}),(0,g.jsx)(S,{item:r,search:n})]}):(0,g.jsx)(m.CheckboxControl,{...h,id:O,name:N,className:"woocommerce-search-list__item-input",value:(0,k.decodeEntities)(r.value),label:y((0,k.decodeEntities)(r.name),n),onChange:l(r),checked:c}),w?(0,g.jsx)(C,{label:e||r.count}):null]})},O=N;var P=s(3028);s(5022);const T=({id:e,label:t,popoverContents:s,remove:o,screenReaderLabel:r,className:i=""})=>{const[l,n]=(0,u.useState)(!1),a=(0,f.useInstanceId)(T);if(r=r||t,!t)return null;t=(0,k.decodeEntities)(t);const d=(0,_.A)("woocommerce-tag",i,{"has-remove":!!o}),x=`woocommerce-tag__label-${a}`,p=(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("span",{className:"screen-reader-text",children:r}),(0,g.jsx)("span",{"aria-hidden":"true",children:t})]});return(0,g.jsxs)("span",{className:d,children:[s?(0,g.jsx)(m.Button,{className:"woocommerce-tag__text",id:x,onClick:()=>n(!0),children:p}):(0,g.jsx)("span",{className:"woocommerce-tag__text",id:x,children:p}),s&&l&&(0,g.jsx)(m.Popover,{onClose:()=>n(!1),children:s}),o&&(0,g.jsx)(m.Button,{className:"woocommerce-tag__remove",onClick:o(e),label:(0,h.sprintf)( // Translators: %s label. // Translators: %s label. (0,h.__)("Remove %s","woocommerce"),t),"aria-describedby":x,children:(0,g.jsx)(c.A,{icon:P.A,size:20,className:"clear-icon",role:"img"})})]})},A=T;s(1939);const I=e=>(0,g.jsx)(O,{...e}),B=e=>{const{list:t,selected:s,renderItem:o,depth:r=0,onSelect:c,instanceId:i,isSingle:l,search:n,useExpandedPanelId:a}=e,[d]=a;return t?(0,g.jsx)(g.Fragment,{children:t.map((t=>{const h=t.children?.length&&!l?t.children.every((({id:e})=>s.find((t=>t.id===e)))):!!s.find((({id:e})=>e===t.id)),m=t.children?.length&&d===t.id;return(0,g.jsxs)(u.Fragment,{children:[(0,g.jsx)("li",{children:o({item:t,isSelected:h,onSelect:c,isSingle:l,selected:s,search:n,depth:r,useExpandedPanelId:a,controlId:i})}),m?(0,g.jsx)(B,{...e,list:t.children,depth:r+1}):null]},t.id)}))}):null},R=({isLoading:e,isSingle:t,selected:s,messages:o,onChange:r,onRemove:c})=>{if(e||t||!s)return null;const i=s.length;return(0,g.jsxs)("div",{className:"woocommerce-search-list__selected",children:[(0,g.jsxs)("div",{className:"woocommerce-search-list__selected-header",children:[(0,g.jsx)("strong",{children:o.selected(i)}),i>0?(0,g.jsx)(m.Button,{variant:"link",isDestructive:!0,onClick:()=>r([]),"aria-label":o.clear,children:(0,h.__)("Clear all","woocommerce")}):null]}),i>0?(0,g.jsx)("ul",{children:s.map(((e,t)=>(0,g.jsx)("li",{children:(0,g.jsx)(A,{label:e.name,id:e.id,remove:c})},t)))}):null]})},F=({filteredList:e,search:t,onSelect:s,instanceId:o,useExpandedPanelId:r,...i})=>{const{messages:l,renderItem:n,selected:a,isSingle:d}=i,m=n||I;return 0===e.length?(0,g.jsxs)("div",{className:"woocommerce-search-list__list is-not-found",children:[(0,g.jsx)("span",{className:"woocommerce-search-list__not-found-icon",children:(0,g.jsx)(c.A,{icon:b.A,role:"img"})}),(0,g.jsx)("span",{className:"woocommerce-search-list__not-found-text",children:t?(0,h.sprintf)(l.noResults,t):l.noItems})]}):(0,g.jsx)("ul",{className:"woocommerce-search-list__list",children:(0,g.jsx)(B,{useExpandedPanelId:r,list:e,selected:a,renderItem:m,onSelect:s,instanceId:o,isSingle:d,search:t})})},$=e=>{const{className:t="",isCompact:s,isHierarchical:o,isLoading:r,isSingle:c,list:i,messages:l=j,onChange:n,onSearch:a,selected:d,type:x="text",debouncedSpeak:p}=e,[w,b]=(0,u.useState)(""),y=(0,u.useState)(-1),v=(0,f.useInstanceId)($),k=(0,u.useMemo)((()=>({...j,...l})),[l]),C=(0,u.useMemo)((()=>((e,t,s)=>{if(!t)return s?E(e):e;const o=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),r=e.map((e=>!!o.test(e.name)&&e)).filter(Boolean);return s?E(r,e):r})(i,w,o)),[i,w,o]);(0,u.useEffect)((()=>{p&&p(k.updated)}),[p,k]),(0,u.useEffect)((()=>{"function"==typeof a&&a(w)}),[w,a]);const S=(0,u.useCallback)((e=>()=>{c&&n([]);const t=d.findIndex((({id:t})=>t===e));n([...d.slice(0,t),...d.slice(t+1)])}),[c,d,n]),N=(0,u.useCallback)((e=>()=>{Array.isArray(e)?n(e):-1===d.findIndex((({id:t})=>t===e.id))?n(c?[e]:[...d,e]):S(e.id)()}),[c,S,n,d]),O=(0,u.useCallback)((e=>{const[t]=d.filter((t=>!e.find((e=>t.id===e.id))));S(t.id)()}),[S,d]);return(0,g.jsxs)("div",{className:(0,_.A)("woocommerce-search-list",t,{"is-compact":s,"is-loading":r,"is-token":"token"===x}),children:["text"===x&&(0,g.jsx)(R,{...e,onRemove:S,messages:k}),(0,g.jsx)("div",{className:"woocommerce-search-list__search",children:"text"===x?(0,g.jsx)(m.TextControl,{label:k.search,type:"search",value:w,onChange:e=>b(e)}):(0,g.jsx)(m.FormTokenField,{disabled:r,label:k.search,onChange:O,onInputChange:e=>b(e),suggestions:[],__experimentalValidateInput:()=>!1,value:r?[(0,h.__)("Loading…","woocommerce")]:d.map((e=>({...e,value:e.name}))),__experimentalShowHowTo:!1})}),r?(0,g.jsx)("div",{className:"woocommerce-search-list__list",children:(0,g.jsx)(m.Spinner,{})}):(0,g.jsx)(F,{...e,search:w,filteredList:C,messages:k,onSelect:N,instanceId:v,useExpandedPanelId:y})]})};(0,m.withSpokenMessages)($);var M=s(4347);const L=({item:e,search:t,depth:s=0,...o})=>{const r=e.breadcrumbs.length?`${e.breadcrumbs.join(", ")}, ${e.name}`:e.name;return(0,g.jsx)(N,{className:(0,_.A)("woocommerce-product-tags__item","has-count",{"is-searching":t.length>0,"is-skip-level":0===s&&0!==e.parent}),item:e,search:t,depth:s,...o,ariaLabel:(0,h.sprintf)(/* translators: %1$d is the count of products, %2$s is the name of the tag. */ /* translators: %1$d is the count of products, %2$s is the name of the tag. */ (0,h._n)("%1$d product tagged as %2$s","%1$d products tagged as %2$s",e.count,"woocommerce"),e.count,r)})},D=window.wp.url,W=window.wp.apiFetch;var V=s.n(W);const J=({selected:e=[],search:t})=>{const s=(({selected:e=[],search:t})=>{const s=(0,r.getSetting)("limitTags",!1),o=[(0,D.addQueryArgs)("wc/store/v1/products/tags",{per_page:s?100:0,orderby:s?"count":"name",order:s?"desc":"asc",search:t})];return s&&e.length&&o.push((0,D.addQueryArgs)("wc/store/v1/products/tags",{include:e})),o})({selected:e,search:t});return Promise.all(s.map((e=>V()({path:e})))).then((e=>((e,t)=>{const s=new Map;return e.filter((e=>{const o=t(e);return!s.has(o)&&(s.set(o,e),!0)}))})(e.flat(),(e=>e.id))))};s(9910);const H=({isCompact:e=!1,onChange:t,onOperatorChange:s,operator:o="any",selected:c})=>{const[i,l]=(0,u.useState)([]),[n,a]=(0,u.useState)(!0),[d,x]=(0,u.useState)(!1),p=(0,r.getSetting)("limitTags",!1),w=(0,u.useMemo)((()=>i.filter((e=>c.includes(e.id)))),[i,c]),b=(0,u.useCallback)((e=>{a(!0),J({selected:c,search:e}).then((e=>{l(e),a(!1)})).catch((()=>{a(!1)}))}),[c]);(0,u.useEffect)((()=>{d||(b(""),x(!0))}),[b,d]);const _=(0,M.YQ)(b,400),f={clear:(0,h.__)("Clear all product tags","woocommerce"),list:(0,h.__)("Product Tags","woocommerce"),noItems:(0,h.__)("You have not set up any product tags on your store.","woocommerce"),search:(0,h.__)("Search for product tags","woocommerce"),selected:e=>(0,h.sprintf)(/* translators: %d is the count of selected tags. */ /* translators: %d is the count of selected tags. */ (0,h._n)("%d tag selected","%d tags selected",e,"woocommerce"),e),updated:(0,h.__)("Tag search results updated.","woocommerce")};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)($,{className:"woocommerce-product-tags",list:i,isLoading:n,selected:w,onChange:t,onSearch:p?_:void 0,renderItem:L,messages:f,isCompact:e,isHierarchical:!0,isSingle:!1}),!!s&&(0,g.jsx)("div",{hidden:c.length<2,children:(0,g.jsx)(m.SelectControl,{className:"woocommerce-product-tags__operator",label:(0,h.__)("Display products matching","woocommerce"),help:(0,h.__)("Pick at least two tags to use this setting.","woocommerce"),value:o,onChange:s,options:[{label:(0,h.__)("Any selected tags","woocommerce"),value:"any"},{label:(0,h.__)("All selected tags","woocommerce"),value:"all"}]})})]})},Q=({value:e,setAttributes:t})=>(0,g.jsx)(m.SelectControl,{label:(0,h.__)("Order products by","woocommerce"),value:e,options:[{label:(0,h.__)("Newness - newest first","woocommerce"),value:"date"},{label:(0,h.__)("Price - low to high","woocommerce"),value:"price_asc"},{label:(0,h.__)("Price - high to low","woocommerce"),value:"price_desc"},{label:(0,h.__)("Rating - highest first","woocommerce"),value:"rating"},{label:(0,h.__)("Sales - most first","woocommerce"),value:"popularity"},{label:(0,h.__)("Title - alphabetical","woocommerce"),value:"title"},{label:(0,h.__)("Menu Order","woocommerce"),value:"menu_order"}],onChange:e=>t({orderby:e})}),G=(0,r.getSetting)("hideOutOfStockItems",!1),Y=(0,r.getSetting)("stockStatusOptions",{}),z=({value:e,setAttributes:t})=>{const{outofstock:s,...o}=Y,r=G?o:Y,c=Object.entries(r).map((([e,t])=>({value:e,label:t}))).filter((e=>!!e.label)),i=Object.keys(r).filter((e=>!!e)),[l,n]=(0,u.useState)(e||i);(0,u.useEffect)((()=>{t({stockStatus:["",...l]})}),[l,t]);const a=(0,u.useCallback)((e=>{const t=l.includes(e),s=l.filter((t=>t!==e));t||(s.push(e),s.sort()),n(s)}),[l]);return(0,g.jsx)(g.Fragment,{children:c.map((e=>{const t=l.includes(e.value)?/* translators: %s stock status. */ /* translators: %s stock status. */(0,h.__)('Stock status "%s" visible.',"woocommerce"):/* translators: %s stock status. */ /* translators: %s stock status. */(0,h.__)('Stock status "%s" hidden.',"woocommerce");return(0,g.jsx)(m.ToggleControl,{label:e.label,help:(0,h.sprintf)(t,e.label),checked:l.includes(e.value),onChange:()=>a(e.value)},e.value)}))})},K=(0,g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"},children:[(0,g.jsx)("title",{children:"Grid Block Preview"}),(0,g.jsx)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,g.jsx)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,g.jsx)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,g.jsx)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,g.jsx)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,g.jsx)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,g.jsx)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,g.jsx)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,g.jsx)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,g.jsx)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,g.jsx)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,g.jsx)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,g.jsx)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"})]}),X=window.wc.wcTypes,q=(0,m.withSpokenMessages)((({attributes:e,name:t,setAttributes:s,debouncedSpeak:o})=>{const[l,a]=(0,u.useState)({}),[p,b]=(0,u.useState)(!1);(0,u.useEffect)((()=>{e.tags.length||b(!0)}),[e.tags.length]);const _=()=>{b(!1),a({})};return e.isPreview?K:(0,r.getSetting)("hasTags",!0)?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(n.BlockControls,{children:(0,g.jsx)(m.ToolbarGroup,{controls:[{icon:"edit",title:(0,h.__)("Edit selected tags","woocommerce"),onClick:()=>p?_():(b(!0),void a({})),isActive:p}]})}),(()=>{const{columns:t,tagOperator:o,contentVisibility:c,orderby:i,rows:l,alignButtons:a,stockStatus:d}=e;return(0,g.jsxs)(n.InspectorControls,{children:[(0,g.jsx)(m.PanelBody,{title:(0,h.__)("Product Tag","woocommerce"),initialOpen:!e.tags.length&&!p,children:(0,g.jsx)(H,{selected:e.tags,onChange:(e=[])=>{const t=e.map((({id:e})=>e));s({tags:t})},operator:o,onOperatorChange:(e="any")=>s({tagOperator:e}),isCompact:!0})}),(0,g.jsx)(m.PanelBody,{title:(0,h.__)("Layout","woocommerce"),initialOpen:!0,children:(0,g.jsx)(w,{columns:t,rows:l,alignButtons:a,setAttributes:s,minColumns:(0,r.getSettingWithCoercion)("minColumns",1,X.isNumber),maxColumns:(0,r.getSettingWithCoercion)("maxColumns",6,X.isNumber),minRows:(0,r.getSettingWithCoercion)("minRows",6,X.isNumber),maxRows:(0,r.getSettingWithCoercion)("maxRows",6,X.isNumber)})}),(0,g.jsx)(m.PanelBody,{title:(0,h.__)("Content","woocommerce"),initialOpen:!0,children:(0,g.jsx)(x,{settings:c,onChange:e=>s({contentVisibility:e})})}),(0,g.jsx)(m.PanelBody,{title:(0,h.__)("Order By","woocommerce"),initialOpen:!1,children:(0,g.jsx)(Q,{setAttributes:s,value:i})}),(0,g.jsx)(m.PanelBody,{title:(0,h.__)("Filter by stock status","woocommerce"),initialOpen:!1,children:(0,g.jsx)(z,{setAttributes:s,value:d})})]},"inspector")})(),p?(()=>{const t={...e,...l};return(0,g.jsxs)(m.Placeholder,{icon:(0,g.jsx)(c.A,{icon:i.A,className:"block-editor-block-icon"}),label:(0,h.__)("Products by Tag","woocommerce"),className:"wc-block-products-grid wc-block-product-tag",children:[(0,h.__)("Display a grid of products from your selected tags.","woocommerce"),(0,g.jsxs)("div",{className:"wc-block-product-tag__selection",children:[(0,g.jsx)(H,{selected:t.tags,onChange:(e=[])=>{const t=e.map((({id:e})=>e));a({...l,tags:t})},operator:t.tagOperator,onOperatorChange:(e="any")=>a({...l,tagOperator:e})}),(0,g.jsx)(m.Button,{variant:"primary",onClick:()=>{s(l),_(),o((0,h.__)("Showing Products by Tag block preview.","woocommerce"))},children:(0,h.__)("Done","woocommerce")}),(0,g.jsx)(m.Button,{className:"wc-block-product-tag__cancel-button",variant:"tertiary",onClick:()=>{_(),o((0,h.__)("Showing Products by Tag block preview.","woocommerce"))},children:(0,h.__)("Cancel","woocommerce")})]})]})})():(()=>{const s=e.tags.length;return(0,g.jsx)(m.Disabled,{children:s?(0,g.jsx)(d(),{block:t,attributes:e}):(0,g.jsx)(m.Placeholder,{icon:(0,g.jsx)(c.A,{icon:i.A,className:"block-editor-block-icon"}),label:(0,h.__)("Products by Tag","woocommerce"),className:"wc-block-products-grid wc-block-product-tag",children:(0,h.__)("This block displays products from selected tags. Select at least one tag to display its products.","woocommerce")})})})()]}):(0,g.jsx)(m.Placeholder,{icon:(0,g.jsx)(c.A,{icon:i.A,className:"block-editor-block-icon"}),label:(0,h.__)("Products by Tag","woocommerce"),className:"wc-block-products-grid wc-block-product-tag",children:(0,h.__)("This block displays products from selected tags. To use it you first need to create products and assign tags to them.","woocommerce")})}));s(5152),(0,o.registerBlockType)(l,{icon:{src:(0,g.jsx)(c.A,{icon:i.A,className:"wc-block-editor-components-block-icon"})},attributes:{...l.attributes,columns:{type:"number",default:(0,r.getSetting)("defaultColumns",3)},rows:{type:"number",default:(0,r.getSetting)("defaultRows",3)},tags:{type:"array",default:[]},stockStatus:{type:"array",default:Object.keys((0,r.getSetting)("stockStatusOptions",[]))}},edit:e=>{const t=(0,n.useBlockProps)();return(0,g.jsx)("div",{...t,children:(0,g.jsx)(q,{...e})})},save:()=>null})},5152:()=>{},9910:()=>{},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}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return o[e].call(s.exports,s,s.exports,c),s.exports}c.m=o,e=[],c.O=(t,s,o,r)=>{if(!s){var i=1/0;for(d=0;d<e.length;d++){for(var[s,o,r]=e[d],l=!0,n=0;n<s.length;n++)(!1&r||i>=r)&&Object.keys(c.O).every((e=>c.O[e](s[n])))?s.splice(n--,1):(l=!1,r<i&&(i=r));if(l){e.splice(d--,1);var a=o();void 0!==a&&(t=a)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[s,o,r]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},s=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var r=Object.create(null);c.r(r);var i={};t=t||[null,s({}),s([]),s(s)];for(var l=2&o&&e;"object"==typeof l&&!~t.indexOf(l);l=s(l))Object.getOwnPropertyNames(l).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,c.d(r,i),r},c.d=(e,t)=>{for(var s in t)c.o(t,s)&&!c.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.j=1235,(()=>{var e={1235:0};c.O.j=t=>0===e[t];var t=(t,s)=>{var o,r,[i,l,n]=s,a=0;if(i.some((t=>0!==e[t]))){for(o in l)c.o(l,o)&&(c.m[o]=l[o]);if(n)var d=n(c)}for(t&&t(s);a<i.length;a++)r=i[a],c.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return c.O(d)},s=globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var i=c.O(void 0,[94],(()=>c(885)));i=c.O(i),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["product-tag"]=i})();
/home/batcwwjx/www/wp-content/plugins/woocommerce/assets/client/blocks/product-tag.js