"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[71],{84560:(e,t,o)=>{o.d(t,{Z:()=>c});var n=o(69307),r=o(70444);const c=(0,n.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(r.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}))},66602:(e,t,o)=>{o.d(t,{_$:()=>v,U_:()=>h,XG:()=>T,b:()=>m});var n=o(69307),r=o(65736),c=o(55609),a=o(9818),i=o(75606),l=o(46530),s=o(51393),d=o(74693);const m=e=>{let{onClick:t}=e;const{showCesModal:o}=(0,a.useDispatch)(i.STORE_KEY),{isDescendantOf:m}=(0,l.useLayoutContext)();return(0,n.createElement)(c.MenuItem,{onClick:()=>{o({action:"new_product",showDescription:!1,title:(0,r.__)("What do you think of the new product form?","woocommerce"),firstQuestion:(0,r.__)("The product editing screen is easy to use","woocommerce"),secondQuestion:(0,r.__)("The product editing screen's functionality meets my needs","woocommerce"),onsubmitLabel:(0,r.__)("Thanks for the feedback — we'll put it to good use!","woocommerce"),getExtraFieldsToBeShown:(e,t,o)=>(0,n.createElement)(n.Fragment,null,(0,n.createElement)(c.BaseControl,{id:"feedback_additional_thoughts",className:"woocommerce-product-feedback__additional-thoughts",label:(0,n.createInterpolateElement)((0,r.__)("ADDITIONAL THOUGHTS <optional />","woocommerce"),{optional:(0,n.createElement)("span",{className:"woocommerce-product-feedback__optional-input"},(0,r.__)("(OPTIONAL)","woocommerce"))})},(0,n.createElement)(c.TextareaControl,{value:e.additional_thoughts||"",onChange:o=>t({...e,additional_thoughts:o}),help:(null==o?void 0:o.additional_thoughts)||""})),(0,n.createElement)(c.BaseControl,{id:"feedback_email",className:"woocommerce-product-feedback__email",label:(0,n.createInterpolateElement)((0,r.__)("YOUR EMAIL ADDRESS <optional />","woocommerce"),{optional:(0,n.createElement)("span",{className:"woocommerce-product-feedback__optional-input"},(0,r.__)("(OPTIONAL)","woocommerce"))})},(0,n.createElement)(c.TextControl,{value:e.email||"",onChange:o=>t({...e,email:o}),help:(null==o?void 0:o.email)||""}),(0,n.createElement)("span",null,(0,r.__)("In case you want to participate in further discussion and future user research.","woocommerce")))),validateExtraFields:e=>{let{email:t="",additional_thoughts:o=""}=e;const n={};return t.length>0&&!(0,s.isValidEmail)(t)&&(n.email=(0,r.__)("Please enter a valid email address.","woocommerce")),(null==o?void 0:o.length)>500&&(n.additional_thoughts=(0,r.__)("Please enter no more than 500 characters.","woocommerce")),n}},{shouldShowComments:()=>!1},{type:"snackbar"},{block_editor:m("product-block-editor")}),t()},icon:(0,n.createElement)(d.A,null),iconPosition:"right"},(0,r.__)("Share feedback","woocommerce"))};var u=o(74617),_=o(67221),p=o(73463);const h=e=>{let{onClick:t,productId:o}=e;const{showProductMVPFeedbackModal:l}=(0,a.useDispatch)(i.STORE_KEY),{allowTracking:s,resolving:d}=(0,a.useSelect)((e=>{const{getOption:t,hasFinishedResolution:o}=e(_.OPTIONS_STORE_NAME);return{allowTracking:"yes"===(t(i.ALLOW_TRACKING_OPTION_NAME)||"no"),resolving:!o("getOption",[i.ALLOW_TRACKING_OPTION_NAME])}})),m=(0,p.O3)("_feature_nonce"),h=o?(0,u.getAdminLink)(`post.php?post=${o}&action=edit&product_block_editor=0&_feature_nonce=${m}`):(0,u.getAdminLink)(`post-new.php?post_type=product&product_block_editor=0&_feature_nonce=${m}`);return d?null:(0,n.createElement)(c.MenuItem,{onClick:function(){s?l():window.location.href=h,t()},info:(0,r.__)("Save changes and go back to the classic product editing screen.","woocommerce")},(0,r.__)("Turn off the new product form","woocommerce"))};var g=o(23374),w=o(84560),E=o(90495),f=o(65545);const v=e=>{let{onClick:t=(()=>null),onCloseGuide:o}=e;const[a,i]=(0,n.useState)(!1),{isNewUser:l}=(0,f.E)();return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(c.MenuItem,{onClick:()=>{i(!0),t()},icon:(0,n.createElement)(g.Z,{icon:w.Z}),iconPosition:"right"},(0,r.__)("About the form…","woocommerce")),a&&(0,n.createElement)(E.Z,{isNewUser:l,onCloseGuide:()=>{i(!1),o()}}))};var b=o(85597),k=o(10431),C=o(14599),y=o(37798);const T=e=>{let{onClose:t}=e;const[o,i]=(0,n.useState)(!1),{productId:l}=(0,b.UO)(),d=(0,y.useEntityId)("postType","product_variation"),{invalidateVariationList:m,goToNextVariation:u,goToPreviousVariation:p,numberOfVariations:h}=(0,s.__experimentalUseVariationSwitcher)({parentId:l?parseInt(l,10):void 0,variationId:d}),[g]=(0,y.useEntityProp)("postType","product_variation","name"),[w]=(0,y.useEntityProp)("postType","product_variation","status"),{deleteProductVariation:E}=(0,a.useDispatch)(_.EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME),{createSuccessNotice:f,createErrorNotice:v}=(0,a.useDispatch)("core/notices");return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(c.MenuGroup,null,(0,n.createElement)(c.MenuItem,{isDestructive:!0,variant:"tertiary",onClick:function(){(0,C.recordEvent)("product_dropdown_option_click",{selected_option:"delete_variation",product_id:l,variation_id:d,product_status:w}),i(!0)}},(0,r.__)("Delete variation","woocommerce"))),o&&(0,n.createElement)(s.RemoveConfirmationModal,{title:(0,r.sprintf)((0,r.__)("Delete %s?","woocommerce"),g),description:(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,r.__)("If you continue, this variation with all of its information will be deleted and customers will no longer be able to purchase it.","woocommerce")),(0,n.createElement)("strong",null,(0,r.__)("Deleted variations cannot be restored.","woocommerce"))),onRemove:async function(){return(0,C.recordEvent)("product_delete_variation_modal",{action:"delete",product_id:l,variation_id:d,product_status:w}),E({product_id:l,id:d}).then((()=>{f((0,r.sprintf)((0,r.__)("%s deleted.","woocommerce"),g)),i(!1),t(),m(),h&&h>1?u()||p():(0,k.navigateTo)({url:(0,k.getNewPath)({},`/product/${l}`)})})).catch((()=>{v((0,r.__)("Failed to delete the variation.","woocommerce"))}))},onCancel:function(){(0,C.recordEvent)("product_delete_variation_modal",{action:"close",product_id:l,variation_id:d,product_status:w}),i(!1)}}))}},81596:(e,t,o)=>{o.d(t,{e:()=>d});var n=o(69307),r=o(55609),c=o(65736),a=o(14599),i=o(9818),l=o(37798),s=o(66602);const d=e=>{var t;let{productType:o="product",onClose:d}=e;const[m]=(0,l.useEntityProp)("postType",o,"id"),u=(0,i.useSelect)((e=>{const{getEntityRecord:t}=e("core");return t("postType",o,m)}),[m,o]),_=e=>{(0,a.recordEvent)("product_dropdown_option_click",{selected_option:e,product_type:u.type,product_status:u.status})};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.MenuGroup,{label:(0,c.__)("New product form (Beta)","woocommerce")},(0,n.createElement)(s._$,{onClick:()=>{_("about")},onCloseGuide:()=>{d()}}),(0,n.createElement)(s.b,{onClick:()=>{_("feedback"),d()}})),(0,n.createElement)(r.MenuGroup,null,(0,n.createElement)(s.U_,{productId:null!==(t=u.parent_id)&&void 0!==t?t:u.id,onClick:()=>{_("classic_editor"),d()}})))}},90495:(e,t,o)=>{o.d(t,{Z:()=>p});var n=o(69307),r=o(65736),c=o(83849),a=o.n(c),i=o(55609),l=o(70444);const s=e=>{let{isSelected:t}=e;return(0,n.createElement)(l.SVG,{width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(l.Circle,{cx:"4",cy:"4",r:"4",fill:t?"#419ECD":"#E1E3E6"}))};function d(e){let{currentPage:t,numberOfPages:o,setCurrentPage:c}=e;return(0,n.createElement)("ul",{className:"components-guide__page-control","aria-label":(0,r.__)("Guide controls","woocommerce")},Array.from({length:o}).map(((e,a)=>(0,n.createElement)("li",{key:a,"aria-current":a===t?"step":void 0},(0,n.createElement)(i.Button,{key:a,icon:(0,n.createElement)(s,{isSelected:a===t}),"aria-label":(0,r.sprintf)((0,r.__)("Page %1$d of %2$d","woocommerce"),a+1,o),onClick:()=>c(a)})))))}const m=function(e){let{className:t,contentLabel:o,finishButtonText:c=(0,r.__)("Finish","woocommerce"),finishButtonLink:l,onFinish:s,pages:m=[]}=e;const u=(0,n.useRef)(null),[_,p]=(0,n.useState)(0),h=_>0,g=_<m.length-1,w=()=>{h&&p(_-1)},E=()=>{g&&p(_+1)};return 0===m.length?null:(0,n.createElement)(i.Modal,{className:a()("components-guide",t),title:o,onRequestClose:()=>{s(_,"close")},onKeyDown:e=>{"ArrowLeft"===e.code?(w(),e.preventDefault()):"ArrowRight"===e.code&&(E(),e.preventDefault())},ref:u},(0,n.createElement)("div",{className:"components-guide__container"},(0,n.createElement)("div",{className:"components-guide__page"},m[_].image,m.length>1&&(0,n.createElement)(d,{currentPage:_,numberOfPages:m.length,setCurrentPage:p}),m[_].content),(0,n.createElement)("div",{className:"components-guide__footer"},h&&(0,n.createElement)(i.Button,{className:"components-guide__back-button",variant:"tertiary",onClick:w},(0,r.__)("Previous","woocommerce")),g&&(0,n.createElement)(i.Button,{className:"components-guide__forward-button",variant:"primary",onClick:E},(0,r.__)("Next","woocommerce")),!g&&(0,n.createElement)(i.Button,{className:"components-guide__finish-button",variant:"primary",href:l,target:l?"_blank":void 0,rel:l?"noopener":void 0,onClick:()=>s(_,"finish")},c))))},u=e=>{let{page:t}=e;return(0,n.createElement)(n.Fragment,null,(0,n.createElement)("h1",{className:"woocommerce-block-editor-guide__heading"},t.heading),(0,n.createElement)("p",{className:"woocommerce-block-editor-guide__text"},t.text))},_=e=>{let{page:t}=e;return(0,n.createElement)("div",{className:`woocommerce-block-editor-guide__header woocommerce-block-editor-guide__header-${t.index+1}`})},p=e=>{let{onCloseGuide:t}=e;const o=[{heading:(0,r.__)("Fresh and modern interface","woocommerce"),text:(0,r.__)("Everything you need to create and sell your products, all in one place. From photos and descriptions to pricing and inventory, all of your product settings can be found here.","woocommerce")},{heading:(0,r.__)("Content-rich product descriptions","woocommerce"),text:(0,r.__)("Show off what's great about your products and engage your customers with content-rich product descriptions. Add images, videos, and any other content they might need to make a purchase.","woocommerce")},{heading:(0,r.__)("Lightning fast performance ","woocommerce"),text:(0,r.__)("Get your products listed and available for purchase in no time! Our modern technology ensures a reliable and streamlined experience.","woocommerce")},{heading:(0,r.__)("More features are on the way","woocommerce"),text:(0,r.__)("We're actively working on adding more features to the product form, including the ability to add digital products, variations, and more. Watch this space!","woocommerce")}].map(((e,t)=>({content:(0,n.createElement)(u,{page:e}),image:(0,n.createElement)(_,{page:{...e,index:t}})})));return(0,n.createElement)(m,{className:"woocommerce-block-editor-guide",contentLabel:"",finishButtonText:(0,r.__)("Tell me more","woocommerce"),finishButtonLink:"https://woo.com/product-form-beta",onFinish:t,pages:o})}},65545:(e,t,o)=>{o.d(t,{E:()=>a});var n=o(67221),r=o(9818);const c={status:"publish",_fields:["id"]},a=()=>(0,r.useSelect)((e=>{const{getProductsTotalCount:t,hasFinishedResolution:o}=e(n.PRODUCTS_STORE_NAME),r=t(c,0);return{publishedProductsCount:r,loadingPublishedProductsCount:!o("getProductsTotalCount",[c,0]),isNewUser:r<1}}))}}]);