"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[997],{3581:(e,t,o)=>{o.r(t),o.d(t,{Products:()=>C});var r=o(69307),c=o(66811),n=o(98817),a=o(65736),l=o(23374),s=o(86241),i=o(73224),m=o(55609),d=o(74617),p=o(14599),u=o(53389),_=o(86020);const k=({items:e})=>(0,r.createElement)("div",{className:"woocommerce-products-card-list"},(0,r.createElement)(_.List,{items:e}));var v=o(17624);const g=[{key:"from-csv",title:(0,a.__)("FROM A CSV FILE","woocommerce"),content:(0,a.__)("Import all products at once by uploading a CSV file.","woocommerce"),before:(0,r.createElement)(v.Z,null),onClick:()=>{(0,p.recordEvent)("tasklist_add_product",{method:"import"}),window.location.href=(0,d.getAdminLink)("edit.php?post_type=product&page=product_importer&wc_onboarding_active_task=products")}}];var w=o(35231),h=o(73838),f=o(69359),b=o(35192),E=o(93914),y=o(69987);const C=()=>{const[e,t]=(0,r.useState)(!1),{recordCompletionTime:o}=(0,y.Z)("products"),[c,n]=(0,r.useState)(!1),_=(0,r.useMemo)((()=>g.map((e=>({...e,onClick:()=>{e.onClick(),o()}})))),[o]),{loadSampleProduct:v,isLoadingSampleProducts:C}=(0,b.Z)({redirectUrlAfterSuccess:(0,d.getAdminLink)("edit.php?post_type=product&wc_onboarding_active_task=products")}),{productTypes:O}=(0,w.Z)((0,h.Q)(),[],{onClick:o}),Z=(0,r.createElement)(u.Z,{items:O,onClickLoadSampleProduct:()=>n(!0)});return(0,r.createElement)("div",{className:"woocommerce-task-import-products"},(0,r.createElement)("h1",null,(0,a.__)("Import your products","woocommerce")),(0,r.createElement)(k,{items:_}),(0,r.createElement)("div",{className:"woocommerce-task-import-products-stacks"},(0,r.createElement)(m.Button,{onClick:()=>{(0,p.recordEvent)("tasklist_add_product_from_scratch_click"),t(!e)}},(0,a.__)("Or add your products from scratch","woocommerce"),(0,r.createElement)(l.Z,{icon:e?s.Z:i.Z})),e&&Z),C?(0,r.createElement)(f.Z,null):c&&(0,r.createElement)(E.Z,{onCancel:()=>{n(!1),(0,p.recordEvent)("tasklist_cancel_load_sample_products_click")},onImport:()=>{n(!1),v()}}))};(0,n.registerPlugin)("wc-admin-onboarding-task-products",{scope:"woocommerce-tasks",render:()=>(0,r.createElement)(c.WooOnboardingTask,{id:"products"},(0,r.createElement)(C,null))})},17624:(e,t,o)=>{t.Z=function(e){var t=e.size,o=void 0===t?24:t,r=e.onClick,l=(e.icon,e.className),s=function(e,t){if(null==e)return{};var o,r,c=function(e,t){if(null==e)return{};var o,r,c={},n=Object.keys(e);for(r=0;r<n.length;r++)o=n[r],0<=t.indexOf(o)||(c[o]=e[o]);return c}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(c[o]=e[o])}return c}(e,n),i=["gridicon","gridicons-pages",l,!1,!1,!1].filter(Boolean).join(" ");return c.default.createElement("svg",a({className:i,height:o,width:o,onClick:r},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),c.default.createElement("g",null,c.default.createElement("path",{d:"M16 8H8V6h8v2zm0 2H8v2h8v-2zm4-6v12l-6 6H6a2 2 0 01-2-2V4a2 2 0 012-2h12a2 2 0 012 2zm-2 10V4H6v16h6v-4a2 2 0 012-2h4z"})))};var r,c=(r=o(99196))&&r.__esModule?r:{default:r},n=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)}}}]);