!function(){"use strict";var e,r={8292:function(){var e=window.wp.blocks,r=window.wp.i18n,t=window.wp.blockEditor,n=window.wp.coreData;function a(){return a=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},a.apply(null,arguments)}var o=JSON.parse('{"UU":"surecart/product-sale-badge"}');(0,e.registerBlockType)(o.UU,{edit:e=>{let{attributes:o,setAttributes:c,context:{postId:i}}=e;const{text:s}=o,{record:{meta:{product:l}={}}={}}=(0,n.useEntityRecord)("postType","sc_product",i),u=(0,t.useBlockProps)({className:"sc-tag sc-tag--primary"});return l&&!l?.is_on_sale?null:React.createElement(t.RichText,a({tagName:"div",value:s,onChange:e=>c({text:e}),"aria-label":s?(0,r.__)("Sale Label","surecart"):(0,r.__)("Empty Sale label","surecart"),"data-empty":!s,placeholder:(0,r.__)("Type in sale badge text","surecart"),allowedFormats:["core/bold","core/italic"]},u))}})}},t={};function n(e){var a=t[e];if(void 0!==a)return a.exports;var o=t[e]={exports:{}};return r[e](o,o.exports,n),o.exports}n.m=r,e=[],n.O=function(r,t,a,o){if(!t){var c=1/0;for(u=0;u<e.length;u++){t=e[u][0],a=e[u][1],o=e[u][2];for(var i=!0,s=0;s<t.length;s++)(!1&o||c>=o)&&Object.keys(n.O).every((function(e){return n.O[e](t[s])}))?t.splice(s--,1):(i=!1,o<c&&(c=o));if(i){e.splice(u--,1);var l=a();void 0!==l&&(r=l)}}return r}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[t,a,o]},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},function(){var e={8196:0,3340:0};n.O.j=function(r){return 0===e[r]};var r=function(r,t){var a,o,c=t[0],i=t[1],s=t[2],l=0;if(c.some((function(r){return 0!==e[r]}))){for(a in i)n.o(i,a)&&(n.m[a]=i[a]);if(s)var u=s(n)}for(r&&r(t);l<c.length;l++)o=c[l],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return n.O(u)},t=self.webpackChunk_surecart_blocks_next=self.webpackChunk_surecart_blocks_next||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))}();var a=n.O(void 0,[3340],(function(){return n(8292)}));a=n.O(a)}();