FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
packages
/
blocks-next
/
build
/
blocks
/
product-price
Edit File: index.js
!function(){"use strict";var e,r={7005:function(e,r,t){var n=t(1609),o=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};r.jsx=function(e,r,t){var n,s={},l=null,u=null;for(n in void 0!==t&&(l=""+t),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(u=r.ref),r)a.call(r,n)&&!i.hasOwnProperty(n)&&(s[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===s[n]&&(s[n]=r[n]);return{$$typeof:o,type:e,key:l,ref:u,props:s,_owner:c.current}}},9255:function(e,r,t){e.exports=t(7005)},9438:function(e,r,t){var n=window.wp.blocks,o=window.wp.primitives,a=t(9255),c=(0,a.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(o.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"})}),i=window.wp.blockEditor,s=window.wp.i18n,l=window.wp.coreData,u=window.wp.components,p=JSON.parse('{"UU":"surecart/product-list-price"}');(0,n.registerBlockType)(p.UU,{icon:c,edit:e=>{let{attributes:{show_range:r},setAttributes:t,context:{postId:n}}=e;const o=(0,i.useBlockProps)({className:"product-price"}),{record:{meta:{product:a}={}}={}}=(0,l.useEntityRecord)("postType","sc_product",n);return React.createElement(React.Fragment,null,React.createElement(i.InspectorControls,null,React.createElement(u.PanelBody,{title:(0,s.__)("Options","surecart")},React.createElement(u.ToggleControl,{label:(0,s.__)("Price Range","surecart"),help:(0,s.__)("Show a range of prices if multiple prices are available or has variable products.","surecart"),checked:r,onChange:e=>t({show_range:e})}))),React.createElement("div",o,a?.id?r?a?.range_display_amount:a?.display_amount:"$10"))}})},1609:function(e){e.exports=window.React}},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var a=t[e]={exports:{}};return r[e](a,a.exports,n),a.exports}n.m=r,e=[],n.O=function(r,t,o,a){if(!t){var c=1/0;for(u=0;u<e.length;u++){t=e[u][0],o=e[u][1],a=e[u][2];for(var i=!0,s=0;s<t.length;s++)(!1&a||c>=a)&&Object.keys(n.O).every((function(e){return n.O[e](t[s])}))?t.splice(s--,1):(i=!1,a<c&&(c=a));if(i){e.splice(u--,1);var l=o();void 0!==l&&(r=l)}}return r}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[t,o,a]},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},function(){var e={9904:0,9464:0};n.O.j=function(r){return 0===e[r]};var r=function(r,t){var o,a,c=t[0],i=t[1],s=t[2],l=0;if(c.some((function(r){return 0!==e[r]}))){for(o in i)n.o(i,o)&&(n.m[o]=i[o]);if(s)var u=s(n)}for(r&&r(t);l<c.length;l++)a=c[l],n.o(e,a)&&e[a]&&e[a][0](),e[a]=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 o=n.O(void 0,[9464],(function(){return n(9438)}));o=n.O(o)}();
Save
Back