Sid Gifari File Manager
🏠 Root
/
home
/
ailwtbdh
/
public_html
/
wp-content
/
plugins
/
woocommerce
/
assets
/
client
/
blocks
/
@woocommerce
/
stores
/
Editing: store-notices.js
import*as t from"@wordpress/interactivity";var e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const o=(c={getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store},s={},e.d(s,c),s),r=()=>{try{return(0,o.getContext)()}catch(t){return null}},{state:n}=(0,o.store)("woocommerce/store-notices",{state:{get role(){const t=r();return"error"===t?.notice?.type||"success"===t?.notice?.type?"alert":"status"},get isError(){const t=r();return"error"===t?.notice?.type},get isSuccess(){const t=r();return"success"===t?.notice?.type},get isInfo(){const t=r();return"notice"===t?.notice?.type},get notices(){const t=(()=>{try{return(0,o.getContext)("woocommerce/product-collection")}catch(t){return null}})();if(t?.notices)return t.notices;const e=r();return e?.notices?e.notices:[]}},actions:{addNotice:t=>{const{notices:e}=n,o=e.find((e=>e.notice===t.notice)),r=o?o.id:`${Date.now()}-${Math.random().toString(36).substring(2,15)}`;return o||e.push({...t,id:r}),r},removeNotice:t=>{const{notices:e}=n,o="string"==typeof t?t:r()?.notice?.id;if(!o)return;const c=e.findIndex((({id:t})=>t===o));-1!==c&&e.splice(c,1)}},callbacks:{renderNoticeContent:()=>{const t=r(),{ref:e}=(0,o.getElement)();e&&t?.notice&&(e.innerHTML=t.notice.notice)},scrollIntoView:()=>{const{ref:t}=(0,o.getElement)();t&&t.scrollIntoView({behavior:"smooth"})},injectIcon:()=>{const t=r(),{ref:e}=(0,o.getElement)();if(!e||!t?.notice)return;const c=e.querySelector(":scope > svg");c&&c.remove();const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("width","24"),s.setAttribute("height","24"),s.setAttribute("aria-hidden","true"),s.setAttribute("focusable","false");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d",n.isError||n.isInfo?"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z":"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"),s.appendChild(i),e.prepend(s)}}},{lock:!0});var c,s;
Save
Cancel