1 line
5.7 KiB
JavaScript
1 line
5.7 KiB
JavaScript
(()=>{var e,t,o,r={2927:(e,t,o)=>{"use strict";const r=window.wp.blocks;var s=o(7871),n=o(5573),c=o(790);const i=(0,c.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none",children:[(0,c.jsx)("path",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",d:"M6 3.75h12c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H6c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"}),(0,c.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.9 7.5A1.1 1.1 0 018 6.4h8a1.1 1.1 0 011.1 1.1v2a1.1 1.1 0 01-1.1 1.1H8a1.1 1.1 0 01-1.1-1.1v-2zm1.2.1v1.8h7.8V7.6H8.1z",clipRule:"evenodd"}),(0,c.jsx)("path",{fill:"currentColor",d:"M8.5 12h1v1h-1v-1zM8.5 14h1v1h-1v-1zM8.5 16h1v1h-1v-1zM11.5 12h1v1h-1v-1zM11.5 14h1v1h-1v-1zM11.5 16h1v1h-1v-1zM14.5 12h1v1h-1v-1zM14.5 14h1v1h-1v-1zM14.5 16h1v1h-1v-1z"})]}),a=JSON.parse('{"name":"woocommerce/store-notices","title":"Store Notices","description":"Display shopper-facing notifications generated by WooCommerce or extensions.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"interactivity":{"clientNavigation":true},"multiple":false,"align":["wide","full"]},"attributes":{"align":{"type":"string","default":"wide"}},"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}'),l=window.wp.blockEditor;var u=o(7723),p=o(4921),d=o(2905),h=(o(7575),o(7301)),f=o(229),v=o(375);const m=e=>{switch(e){case"success":case"warning":case"info":case"default":return"polite";default:return"assertive"}},w=e=>{switch(e){case"success":return h.A;case"warning":case"info":case"error":return f.A;default:return v.A}};var b=o(6874),x=o(6087);o(6882);const j=(0,x.forwardRef)((e,t)=>{const{className:o,children:r,variant:s="contained",removeTextWrap:n=!1,...i}=e,a=(0,p.A)("wc-block-components-button","wp-element-button",o,s);if("href"in e)return(0,c.jsx)(b.$,{render:(0,c.jsx)("a",{ref:t,href:e.href,children:(0,c.jsx)("div",{className:"wc-block-components-button__text",children:r})}),className:a,...i});const l=n?e.children:(0,c.jsx)("div",{className:"wc-block-components-button__text",children:e.children});return(0,c.jsx)(b.$,{ref:t,className:a,...i,children:l})});var k=o(195);const y=({className:e,status:t="default",children:o,spokenMessage:r=o,onRemove:n=()=>{},isDismissible:i=!0,politeness:a=m(t),summary:l})=>(((e,t)=>{const o="string"==typeof e?e:(0,x.renderToString)(e);(0,x.useEffect)(()=>{o&&(0,k.speak)(o,t)},[o,t])})(r,a),(0,c.jsxs)("div",{className:(0,p.A)(e,"wc-block-components-notice-banner","is-"+t,{"is-dismissible":i}),children:[(0,c.jsx)(s.A,{icon:w(t)}),(0,c.jsxs)("div",{className:"wc-block-components-notice-banner__content",children:[l&&(0,c.jsx)("p",{className:"wc-block-components-notice-banner__summary",children:l}),o]}),!!i&&(0,c.jsx)(j,{className:"wc-block-components-notice-banner__dismiss","aria-label":(0,u.__)("Dismiss this notice","woocommerce"),onClick:e=>{"function"==typeof e?.preventDefault&&e.preventDefault&&e.preventDefault(),n()},removeTextWrap:!0,children:(0,c.jsx)(s.A,{icon:d.A})})]}));o(8677);o(849),(0,r.registerBlockType)(a,{icon:{src:(0,c.jsx)(s.A,{icon:i,className:"wc-block-editor-components-block-icon"})},attributes:{...a.attributes},edit:()=>{const e=(0,l.useBlockProps)({className:"wc-block-store-notices"});return(0,c.jsx)("div",{...e,children:(0,c.jsx)(y,{status:"info",isDismissible:!1,children:(0,u.__)("Notices added by WooCommerce or extensions will show up here.","woocommerce")})})},save:()=>null})},6882:()=>{},7575:()=>{},8677:()=>{},849:()=>{},1609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},195:e=>{"use strict";e.exports=window.wp.a11y},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}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e](o,o.exports,n),o.exports}n.m=r,e=[],n.O=(t,o,r,s)=>{if(!o){var c=1/0;for(u=0;u<e.length;u++){for(var[o,r,s]=e[u],i=!0,a=0;a<o.length;a++)(!1&s||c>=s)&&Object.keys(n.O).every(e=>n.O[e](o[a]))?o.splice(a--,1):(i=!1,s<c&&(c=s));if(i){e.splice(u--,1);var l=r();void 0!==l&&(t=l)}}return t}s=s||0;for(var u=e.length;u>0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[o,r,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var s=Object.create(null);n.r(s);var c={};t=t||[null,o({}),o([]),o(o)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=o(i))Object.getOwnPropertyNames(i).forEach(t=>c[t]=()=>e[t]);return c.default=()=>e,n.d(s,c),s},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=4950,(()=>{var e={4950:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var r,s,[c,i,a]=o,l=0;if(c.some(t=>0!==e[t])){for(r in i)n.o(i,r)&&(n.m[r]=i[r]);if(a)var u=a(n)}for(t&&t(o);l<c.length;l++)s=c[l],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(u)},o=globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var c=n.O(void 0,[94],()=>n(2927));c=n.O(c),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["store-notices"]=c})(); |