"use strict";(self.webpackChunk_wcAdmin_webpackJsonp=self.webpackChunk_wcAdmin_webpackJsonp||[]).push([[7387],{80543:function(e,t,o){o.d(t,{U:function(){return _},b:function(){return d}});var n=o(69307),c=o(65736),r=o(55609),i=o(9818),s=o(75606),l=o(46530),u=o(74693);const d=e=>{let{onClose:t}=e;const{showCesModal:o}=(0,i.useDispatch)(s.STORE_KEY),{isDescendantOf:d}=(0,l.useLayoutContext)();return(0,n.createElement)(r.MenuItem,{onClick:()=>{o({action:"new_product",title:(0,c.__)("How's your experience with the product editor?","woocommerce"),firstQuestion:(0,c.__)("The product editing screen is easy to use","woocommerce"),secondQuestion:(0,c.__)("The product editing screen's functionality meets my needs","woocommerce")},{shouldShowComments:()=>!0},{type:"snackbar",icon:(0,n.createElement)("span",null,"🌟")},{block_editor:d("product-block-editor")}),t()},icon:(0,n.createElement)(u.A,null),iconPosition:"right"},(0,c.__)("Share feedback","woocommerce"))};var a=o(74617),p=o(67221),m=o(51393);const E=()=>(0,n.createElement)("svg",{width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.73365 13.1059L5.91005 10.7253L4.81688 9.69821L0.970703 13.8559L4.81688 18.0137L5.91005 16.9865L3.73365 14.6059H6.54528C7.67008 14.6059 8.79454 14.6362 9.91926 14.6059C11.3464 14.6047 13.2805 14.3559 14.882 13.3288C16.5414 12.2645 17.7498 10.423 17.7498 7.47022C17.7498 4.99134 16.4227 2.57446 14.1007 1.53934C12.279 0.727299 11.0554 0.740873 9.29353 0.751627C9.09868 0.752817 8.90948 0.753973 8.7271 0.753973C8.7271 0.753973 8.7271 1.08588 8.7271 1.50009C8.7271 1.9143 8.7271 2.25397 8.7271 2.25397C8.91043 2.25397 9.09488 2.25326 9.27997 2.25254C11.1006 2.24547 11.9842 2.23816 13.4899 2.90938C15.3434 3.73563 16.2498 5.56574 16.2498 7.47022C16.2498 9.94253 15.2764 11.2938 14.0722 12.0662C12.8139 12.8732 11.2081 13.1059 9.90892 13.1059H9.89866L9.8884 13.1062C8.774 13.1367 7.65978 13.1059 6.54528 13.1059H3.73365Z",fill:"#1E1E1E"})),_=e=>{let{onClose:t,productId:o}=e;const{showProductMVPFeedbackModal:l}=(0,i.useDispatch)(s.STORE_KEY),{updateOptions:u}=(0,i.useDispatch)(p.OPTIONS_STORE_NAME),{allowTracking:d,resolving:_}=(0,i.useSelect)((e=>{const{getOption:t,hasFinishedResolution:o}=e(p.OPTIONS_STORE_NAME);return{allowTracking:"yes"===(t(s.ALLOW_TRACKING_OPTION_NAME)||"no"),resolving:!o("getOption",[s.ALLOW_TRACKING_OPTION_NAME])}})),h=o?(0,a.getAdminLink)(`post.php?post=${o}&action=edit`):(0,a.getAdminLink)("post-new.php?post_type=product");return _?null:(0,n.createElement)(r.MenuItem,{onClick:()=>{d?(u({[m.NEW_PRODUCT_MANAGEMENT_ENABLED_OPTION_NAME]:"no"}),l(),t()):(window.location.href=h,t())},icon:(0,n.createElement)(E,null),iconPosition:"right"},(0,c.__)("Use the classic editor","woocommerce"))}},87539:function(e,t,o){o.r(t),o.d(t,{default:function(){return E}});var n=o(69307),c=o(51393),r=o(55609),i=o(85597),s=o(9818),l=o(98817),u=o(46530),d=o(37798),a=o(80543);const p=e=>{let{onClose:t}=e;const[o]=(0,d.useEntityProp)("postType","product","id");return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(a.b,{onClose:t}),(0,n.createElement)(a.U,{productId:o,onClose:t}))},m=()=>{const[e]=(0,d.useEntityProp)("postType","product","id");return(0,n.createElement)(c.__experimentalProductMVPFeedbackModalContainer,{productId:e})};function E(){const{productId:e}=(0,i.UO)(),t=function(e){const{saveEntityRecord:t}=(0,s.useDispatch)("core"),[o,r]=(0,n.useState)(void 0);return(0,n.useEffect)((()=>{(e?(0,s.resolveSelect)("core").getEntityRecord("postType","product",Number.parseInt(e,10)):t("postType","product",{title:c.AUTO_DRAFT_NAME,status:"auto-draft"})).then((e=>{r(e)})).catch((e=>{throw r(void 0),e}))}),[e]),o}(e);return(0,n.useEffect)((()=>(0,c.__experimentalInitBlocks)()),[]),null!=t&&t.id?(0,n.createElement)(c.__experimentalEditor,{product:t,settings:productBlockEditorSettings||{}}):(0,n.createElement)(r.Spinner,null)}(0,l.registerPlugin)("wc-admin-more-menu",{scope:"woocommerce-product-block-editor",render:()=>(0,n.createElement)(n.Fragment,null,(0,n.createElement)(c.__experimentalWooProductMoreMenuItem,null,(e=>{let{onClose:t}=e;return(0,n.createElement)(p,{onClose:t})})),(0,n.createElement)(u.WooHeaderItem,{name:"product"},(0,n.createElement)(m,null)))}),(0,c.productApiFetchMiddleware)()}}]);