!function(){"use strict";var e,r={7005:function(e,r,t){var n=t(1609),a=Symbol.for("react.element"),o=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function s(e,r,t){var n,s={},i=null,u=null;for(n in void 0!==t&&(i=""+t),void 0!==r.key&&(i=""+r.key),void 0!==r.ref&&(u=r.ref),r)o.call(r,n)&&!c.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:a,type:e,key:i,ref:u,props:s,_owner:l.current}}r.jsx=s,r.jsxs=s},9255:function(e,r,t){e.exports=t(7005)},5459:function(e,r,t){var n=window.wp.blocks,a=window.wp.primitives,o=t(9255),l=(0,o.jsxs)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)(a.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z",fillRule:"evenodd",clipRule:"evenodd"}),(0,o.jsx)(a.Path,{d:"M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15",fillRule:"evenodd",clipRule:"evenodd"}),(0,o.jsx)(a.Circle,{cx:"12",cy:"9",r:"2",fillRule:"evenodd",clipRule:"evenodd"})]}),c=window.wp.blockEditor,s=window.wp.components,i=window.wp.i18n,u=JSON.parse('{"UU":"surecart/product-review-reviewer-name"}');(0,n.registerBlockType)(u.UU,{icon:l,edit:e=>{let{attributes:r,setAttributes:t,context:n}=e;const a=(0,c.useBlockProps)(),{review:o}=n,{format:l}=r;return React.createElement(React.Fragment,null,React.createElement(c.InspectorControls,null,React.createElement(s.PanelBody,{title:(0,i.__)("Settings","surecart")},React.createElement(s.SelectControl,{label:(0,i.__)("Name Format","surecart"),value:l,options:[{label:(0,i.__)("Display Name","surecart"),value:"display_name"},{label:(0,i.__)("First Name","surecart"),value:"first_name"},{label:(0,i.__)("Last Name","surecart"),value:"last_name"},{label:(0,i.__)("First Name Last Name","surecart"),value:"first_last"}],onChange:e=>t({format:e})}))),React.createElement("div",a,(()=>{if(!o?.customer)return(0,i.__)("Reviewer Name","surecart");const e=o?.customer;switch(l){case"first_name":return e?.first_name||e?.name||"";case"last_name":return e?.last_name||e?.name||"";case"first_last":const r=e?.first_name||"",t=e?.last_name||"";return r&&t?`${r} ${t}`:e?.name||"";default:return e?.name||""}})()))}})},1609:function(e){e.exports=window.React}},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 l=1/0;for(u=0;u<e.length;u++){t=e[u][0],a=e[u][1],o=e[u][2];for(var c=!0,s=0;s<t.length;s++)(!1&o||l>=o)&&Object.keys(n.O).every((function(e){return n.O[e](t[s])}))?t.splice(s--,1):(c=!1,o<l&&(l=o));if(c){e.splice(u--,1);var i=a();void 0!==i&&(r=i)}}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={1395:0,427:0};n.O.j=function(r){return 0===e[r]};var r=function(r,t){var a,o,l=t[0],c=t[1],s=t[2],i=0;if(l.some((function(r){return 0!==e[r]}))){for(a in c)n.o(c,a)&&(n.m[a]=c[a]);if(s)var u=s(n)}for(r&&r(t);i<l.length;i++)o=l[i],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,[427],(function(){return n(5459)}));a=n.O(a)}();