????

Your IP : 3.145.60.133


Current Path : /home/multihiv/www/store/wp-content/plugins/woocommerce/assets/client/admin/chunks/
Upload File :
Current File : /home/multihiv/www/store/wp-content/plugins/woocommerce/assets/client/admin/chunks/4457.js

"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[4457,6732],{13913:(e,t,o)=>{o.d(t,{U:()=>w,e:()=>h});var s=o(80225),n=o(69307),r=o(96169),i=o(76292),c=o.n(i),a=o(69596),l=o.n(a),m=o(86020),d=o(55609),u=o(81514),p=o(92819);class _ extends n.Component{render(){const{className:e,hasAction:t,hasDate:o,hasSubtitle:n,lines:r}=this.props,i=(0,s.Z)("woocommerce-activity-card is-loading",e);return(0,u.jsxs)("div",{className:i,"aria-hidden":!0,children:[(0,u.jsx)("span",{className:"woocommerce-activity-card__icon",children:(0,u.jsx)("span",{className:"is-placeholder"})}),(0,u.jsxs)("div",{className:"woocommerce-activity-card__header",children:[(0,u.jsx)("div",{className:"woocommerce-activity-card__title is-placeholder"}),n&&(0,u.jsx)("div",{className:"woocommerce-activity-card__subtitle is-placeholder"}),o&&(0,u.jsx)("div",{className:"woocommerce-activity-card__date",children:(0,u.jsx)("span",{className:"is-placeholder"})})]}),(0,u.jsx)("div",{className:"woocommerce-activity-card__body",children:(0,p.range)(r).map((e=>(0,u.jsx)("span",{className:"is-placeholder"},e)))}),t&&(0,u.jsx)("div",{className:"woocommerce-activity-card__actions",children:(0,u.jsx)("span",{className:"is-placeholder"})})]})}}_.propTypes={className:l().string,hasAction:l().bool,hasDate:l().bool,hasSubtitle:l().bool,lines:l().number},_.defaultProps={hasAction:!1,hasDate:!1,hasSubtitle:!1,lines:1};const h=_;class w extends n.Component{getCard(){const{actions:e,className:t,children:o,date:r,icon:i,subtitle:a,title:l,unread:d}=this.props,p=(0,s.Z)("woocommerce-activity-card",t),_=Array.isArray(e)?e:[e],h=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(r)?c().utc(r).fromNow():r;return(0,u.jsxs)("section",{className:p,children:[d&&(0,u.jsx)("span",{className:"woocommerce-activity-card__unread"}),i&&(0,u.jsx)("span",{className:"woocommerce-activity-card__icon","aria-hidden":!0,children:i}),l&&(0,u.jsxs)("header",{className:"woocommerce-activity-card__header",children:[(0,u.jsx)(m.H,{className:"woocommerce-activity-card__title",children:l}),a&&(0,u.jsx)("div",{className:"woocommerce-activity-card__subtitle",children:a}),h&&(0,u.jsx)("span",{className:"woocommerce-activity-card__date",children:h})]}),o&&(0,u.jsx)(m.Section,{className:"woocommerce-activity-card__body",children:o}),e&&(0,u.jsx)("footer",{className:"woocommerce-activity-card__actions",children:_.map(((e,t)=>(0,n.cloneElement)(e,{key:t})))})]})}render(){const{onClick:e}=this.props;return e?(0,u.jsx)(d.Button,{className:"woocommerce-activity-card__button",onClick:e,children:this.getCard()}):this.getCard()}}w.propTypes={actions:l().oneOfType([l().arrayOf(l().element),l().element]),onClick:l().func,className:l().string,children:l().node,date:l().string,icon:l().node,subtitle:l().node,title:l().oneOfType([l().string,l().node]),unread:l().bool},w.defaultProps={icon:(0,u.jsx)(r.Z,{size:48}),unread:!1}},74589:(e,t,o)=>{o.d(t,{Z:()=>d});var s=o(80225),n=o(69307),r=o(69596),i=o.n(r),c=o(14812),a=o(86020),l=o(81514);class m extends n.Component{render(){const{className:e,menu:t,subtitle:o,title:n,unreadMessages:r}=this.props,i=(0,s.Z)({"woocommerce-layout__inbox-panel-header":o,"woocommerce-layout__activity-panel-header":!o},e),a=r||0;return(0,l.jsxs)("div",{className:i,children:[(0,l.jsxs)("div",{className:"woocommerce-layout__inbox-title",children:[(0,l.jsx)(c.Text,{size:16,weight:600,color:"#23282d",children:n}),(0,l.jsx)(c.Text,{variant:"button",weight:"600",size:"14",lineHeight:"20px",children:a>0&&(0,l.jsx)("span",{className:"woocommerce-layout__inbox-badge",children:r})})]}),(0,l.jsx)("div",{className:"woocommerce-layout__inbox-subtitle",children:o&&(0,l.jsx)(c.Text,{variant:"body.small",size:"14",lineHeight:"20px",children:o})}),t&&(0,l.jsx)("div",{className:"woocommerce-layout__activity-panel-header-menu",children:t})]})}}m.propTypes={className:i().string,unreadMessages:i().number,title:i().string.isRequired,subtitle:i().string,menu:i().shape({type:i().oneOf([a.EllipsisMenu])})};const d=m},30655:(e,t,o)=>{o.r(t),o.d(t,{HelpPanel:()=>x,SETUP_TASK_HELP_ITEMS_FILTER:()=>v,default:()=>j});var s=o(65736),n=o(14812),r=o(9818),i=o(69307),c=o(92694),a=o(59550),l=o(75161),m=o(32196),d=o(92819),u=o(86020),p=o(67221),_=o(43272),h=o(14599),w=o(74589),g=o(27232),k=o(81514);const v="woocommerce_admin_setup_task_help_items";function y(e,t){const{taskName:o}=e;t&&e.recordEvent("help_panel_click",{task_name:o||"homescreen",link:t.currentTarget.href})}const x=({taskName:e,recordEvent:t=h.recordEvent,...o})=>{(0,i.useEffect)((()=>{t("help_panel_open",{task_name:e||"homescreen"})}),[e,t]);const r=function(e){const t=function(e){const{taskName:t}=e;switch(t){case"products":return[{title:(0,s.__)("Adding and Managing Products","woocommerce"),link:"https://woocommerce.com/document/managing-products/?utm_source=help_panel&utm_medium=product"},{title:(0,s.__)("Import products using the CSV Importer and Exporter","woocommerce"),link:"https://woocommerce.com/document/product-csv-importer-exporter/?utm_source=help_panel&utm_medium=product"},{title:(0,s.__)("Migrate products using Cart2Cart","woocommerce"),link:"https://woocommerce.com/products/cart2cart/?utm_source=help_panel&utm_medium=product"},{title:(0,s.__)("Learn more about setting up products","woocommerce"),link:"https://woocommerce.com/documentation/plugins/woocommerce/getting-started/setup-products/?utm_source=help_panel&utm_medium=product"}];case"appearance":return[{title:(0,s.__)("Showcase your products and tailor your shopping experience using Blocks","woocommerce"),link:"https://woocommerce.com/document/woocommerce-blocks/?utm_source=help_panel&utm_medium=product"},{title:(0,s.__)("Manage Store Notice, Catalog View and Product Images","woocommerce"),link:"https://woocommerce.com/document/woocommerce-customizer/?utm_source=help_panel&utm_medium=product"},{title:(0,s.__)("How to choose and change a theme","woocommerce"),link:"https://woocommerce.com/document/choose-change-theme/?utm_source=help_panel&utm_medium=product"}];case"shipping":return function({activePlugins:e,countryCode:t}){const o="US"===t&&!e.includes("woocommerce-services")&&!e.includes("woocommerce-shipping")&&!e.includes("woocommerce-tax");return[{title:(0,s.__)("Setting up Shipping Zones","woocommerce"),link:"https://woocommerce.com/document/setting-up-shipping-zones/?utm_source=help_panel&utm_medium=product"},{title:(0,s.__)("Core Shipping Options","woocommerce"),link:"https://woocommerce.com/documentation/plugins/woocommerce/getting-started/shipping/core-shipping-options/?utm_source=help_panel&utm_medium=product"},{title:(0,s.__)("Product Shipping Classes","woocommerce"),link:"https://woocommerce.com/document/product-shipping-classes/?utm_source=help_panel&utm_medium=product"},o&&{title:(0,s.__)("WooCommerce Shipping setup and configuration","woocommerce"),link:"https://woocommerce.com/document/woocommerce-shipping-and-tax/?utm_source=help_panel&utm_medium=product#section-3"},{title:(0,s.__)("Learn more about configuring your shipping settings","woocommerce"),link:"https://woocommerce.com/document/plugins/woocommerce/getting-started/shipping/?utm_source=help_panel&utm_medium=product"}].filter(Boolean)}(e);case"tax":return function(e){const{countryCode:t,taskLists:o}=e,n=o.reduce(((e,t)=>[...e,...t.tasks]),[]).find((e=>"tax"===e.id));if(!n)return;const{additionalData:r}=n,{woocommerceTaxCountries:i=[],taxJarActivated:c,woocommerceTaxActivated:a,woocommerceShippingActivated:l}=r,m=!c&&i.includes(t)&&!a&&!l;return[{title:(0,s.__)("Setting up Taxes in WooCommerce","woocommerce"),link:"https://woocommerce.com/document/setting-up-taxes-in-woocommerce/?utm_source=help_panel&utm_medium=product"},m&&{title:(0,s.__)("Automated Tax calculation using WooCommerce Tax","woocommerce"),link:"https://woocommerce.com/document/woocommerce-services/?utm_source=help_panel&utm_medium=product#section-10"}].filter(Boolean)}(e);case"payments":return function(e){const{paymentGatewaySuggestions:t}=e;return[{title:(0,s.__)("Which Payment Option is Right for Me?","woocommerce"),link:"https://woocommerce.com/document/premium-payment-gateway-extensions/?utm_source=help_panel&utm_medium=product"},t.woocommerce_payments&&{title:(0,s.__)("WooPayments Start Up Guide","woocommerce"),link:"https://woocommerce.com/document/payments/?utm_source=help_panel&utm_medium=product"},t.woocommerce_payments&&{title:(0,s.__)("WooPayments FAQs","woocommerce"),link:"https://woocommerce.com/documentation/woocommerce-payments/woocommerce-payments-faqs/?utm_source=help_panel&utm_medium=product"},t.stripe&&{title:(0,s.__)("Stripe Setup and Configuration","woocommerce"),link:"https://woocommerce.com/document/stripe/?utm_source=help_panel&utm_medium=product"},t["ppcp-gateway"]&&{title:(0,s.__)("PayPal Checkout Setup and Configuration","woocommerce"),link:"https://woocommerce.com/document/2-0/woocommerce-paypal-payments/?utm_medium=product#section-3"},t.square_credit_card&&{title:(0,s.__)("Square - Get started","woocommerce"),link:"https://woocommerce.com/document/woocommerce-square/?utm_source=help_panel&utm_medium=product"},t.kco&&{title:(0,s.__)("Klarna - Introduction","woocommerce"),link:"https://woocommerce.com/document/klarna-checkout/?utm_source=help_panel&utm_medium=product"},t.klarna_payments&&{title:(0,s.__)("Klarna - Introduction","woocommerce"),link:"https://woocommerce.com/document/klarna-payments/?utm_source=help_panel&utm_medium=product"},t.payfast&&{title:(0,s.__)("Payfast Setup and Configuration","woocommerce"),link:"https://woocommerce.com/document/payfast-payment-gateway/?utm_source=help_panel&utm_medium=product"},t.eway&&{title:(0,s.__)("Eway Setup and Configuration","woocommerce"),link:"https://woocommerce.com/document/eway/?utm_source=help_panel&utm_medium=product"},{title:(0,s.__)("Direct Bank Transfer (BACS)","woocommerce"),link:"https://woocommerce.com/document/bacs/?utm_source=help_panel&utm_medium=product"},{title:(0,s.__)("Cash on Delivery","woocommerce"),link:"https://woocommerce.com/document/cash-on-delivery/?utm_source=help_panel&utm_medium=product"}].filter(Boolean)}(e);case"marketing":return function(e){const{activePlugins:t}=e;return[t.includes("mailpoet")&&{title:(0,s.__)("Get started with Mailpoet","woocommerce"),link:"https://kb.mailpoet.com/category/114-getting-started"},t.includes("google-listings-and-ads")&&{title:(0,s.__)("Set up Google for WooCommerce","woocommerce"),link:"https://woocommerce.com/document/google-listings-and-ads/?utm_medium=product#get-started"},t.includes("pinterest-for-woocommerce")&&{title:(0,s.__)("Set up Pinterest for WooCommerce","woocommerce"),link:"https://woocommerce.com/products/pinterest-for-woocommerce/"},t.includes("mailchimp-for-woocommerce")&&{title:(0,s.__)("Connect Mailchimp for WooCommerce","woocommerce"),link:"https://mailchimp.com/help/connect-or-disconnect-mailchimp-for-woocommerce/"},t.includes("creative-mail-by-constant-contact")&&{title:(0,s.__)("Set up Creative Mail for WooCommerce","woocommerce"),link:"https://app.creativemail.com/kb/help/WooCommerce"}].filter(Boolean)}(e);default:return[{title:(0,s.__)("Get Support","woocommerce"),link:"https://woocommerce.com/my-account/create-a-ticket/?utm_medium=product"},{title:(0,s.__)("Home Screen","woocommerce"),link:"https://woocommerce.com/document/home-screen/?utm_medium=product"},{title:(0,s.__)("Inbox","woocommerce"),link:"https://woocommerce.com/document/home-screen/?utm_medium=product#section-4"},{title:(0,s.__)("Stats Overview","woocommerce"),link:"https://woocommerce.com/document/home-screen/?utm_medium=product#section-5"},{title:(0,s.__)("Store Management","woocommerce"),link:"https://woocommerce.com/document/home-screen/?utm_medium=product#section-10"},{title:(0,s.__)("Store Setup Checklist","woocommerce"),link:"https://woocommerce.com/document/woocommerce-setup-wizard?utm_medium=product#store-setup-checklist"}]}}(e),o={title:(0,s.__)("WooCommerce Docs","woocommerce"),link:"https://woocommerce.com/documentation/?utm_source=help_panel&utm_medium=product"};t.push(o);const r=(0,c.applyFilters)(v,t,e.taskName,e);let i=Array.isArray(r)?r.filter((e=>e instanceof Object&&e.title&&e.link)):[];i.length||(i=[o]);const u=(0,d.partial)(y,e);return i.map((e=>{var t,o;return{title:(0,k.jsx)(n.Text,{as:"div",variant:"button",weight:"600",size:"14",lineHeight:"20px",children:e.title}),before:(0,k.jsx)(a.Z,{icon:l.Z}),after:(0,k.jsx)(a.Z,{icon:m.Z}),linkType:null!==(t=e.linkType)&&void 0!==t?t:"external",target:null!==(o=e.target)&&void 0!==o?o:"_blank",href:e.link,onClick:u}}))}({taskName:e,recordEvent:t,...o});return(0,k.jsxs)(i.Fragment,{children:[(0,k.jsx)(w.Z,{title:(0,s.__)("Documentation","woocommerce")}),(0,k.jsx)(u.Section,{children:(0,k.jsx)(u.List,{items:r,className:"woocommerce-quick-links__list"})})]})},j=(0,_.qC)((0,r.withSelect)((e=>{const{getSettings:t}=e(p.SETTINGS_STORE_NAME),{getActivePlugins:o}=e(p.PLUGINS_STORE_NAME),{general:s={}}=t("general"),n=o(),r=e(p.ONBOARDING_STORE_NAME).getPaymentGatewaySuggestions().reduce(((e,t)=>{const{id:o}=t;return e[o]=!0,e}),{}),i=e(p.ONBOARDING_STORE_NAME).getTaskLists();return{activePlugins:n,countryCode:(0,g.so)(s.woocommerce_default_country),paymentGatewaySuggestions:r,taskLists:i}})))(x)},7295:(e,t,o)=>{o.d(t,{A:()=>u,Z:()=>d});var s=o(76292),n=o.n(s),r=o(92819),i=o(81921),c=o(67221),a=o(10431),l=o(81595),m=o(74617);const d=({indicator:e,primaryData:t,secondaryData:o,currency:s,formatAmount:n,persistedQuery:i})=>{const c=(0,r.find)(t.data,(t=>t.stat===e.stat)),d=(0,r.find)(o.data,(t=>t.stat===e.stat));if(!c||!d)return{};const u=c._links&&c._links.report[0]&&c._links.report[0].href||"",p=function(e,t,o){return e?"/jetpack"===e?(0,m.getAdminLink)("admin.php?page=jetpack#/dashboard"):(0,a.getNewPath)(t,e,{chart:o.chart}):""}(u,i,c),_="/jetpack"===u?"wp-admin":"wc-admin",h="currency"===c.format,w=(0,l.calculateDelta)(c.value,d.value);return{primaryValue:h?n(c.value):(0,l.formatValue)(s,c.format,c.value),secondaryValue:h?n(d.value):(0,l.formatValue)(s,d.format,d.value),delta:w,reportUrl:p,reportUrlType:_}},u=(e,t,o,s)=>{const{getReportItems:r,getReportItemsError:a,isResolving:l}=e(c.REPORTS_STORE_NAME),{woocommerce_default_date_range:m}=e(c.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings"),d=(0,i.getCurrentDates)(o,m),u=d.primary.before,p=d.secondary.before,_=t.map((e=>e.stat)).join(","),h=(0,c.getFilterQuery)({filters:s,query:o}),w={...h,after:(0,i.appendTimestamp)(d.primary.after,"start"),before:(0,i.appendTimestamp)(u,u.isSame(n()(),"day")?"now":"end"),stats:_},g={...h,after:(0,i.appendTimestamp)(d.secondary.after,"start"),before:(0,i.appendTimestamp)(p,p.isSame(n()(),"day")?"now":"end"),stats:_};return{primaryData:r("performance-indicators",w),primaryError:a("performance-indicators",w)||null,primaryRequesting:l("getReportItems",["performance-indicators",w]),secondaryData:r("performance-indicators",g),secondaryError:a("performance-indicators",g)||null,secondaryRequesting:l("getReportItems",["performance-indicators",g]),defaultDateRange:m}}},74784:(e,t,o)=>{o.d(t,{ZP:()=>mt,tv:()=>at});var s=o(69307),n=o(94333),r=o(9818),i=o(80225),c=o(69596),a=o.n(c),l=o(67221),m=o(65736),d=o(74589),u=o(87287),p=o(86020),_=o(55609),h=o(14599),w=o(92819),g=o(52458),k=o(22629),v=o(28302),y=o(10431),x=o(74617),j=o(17844),f=o(13913),C=o(91978),b=o(81514);function S(e){(0,h.recordEvent)(`activity_panel_orders_${e}`,{})}const N=()=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(f.U,{className:"woocommerce-empty-activity-card",title:"",icon:"",children:[(0,b.jsx)("span",{className:"woocommerce-order-empty__success-icon",role:"img","aria-labelledby":"woocommerce-order-empty-message",children:"🎉"}),(0,b.jsx)(p.H,{id:"woocommerce-order-empty-message",children:(0,m.__)("You’ve fulfilled all your orders","woocommerce")})]}),(0,b.jsx)(p.Link,{href:"edit.php?post_type=shop_order",onClick:()=>S("orders_manage"),className:"woocommerce-layout__activity-panel-outbound-link woocommerce-layout__activity-panel-empty",type:"wp-admin",children:(0,m.__)("Manage all orders","woocommerce")})]});function E(e,t,o){if(0===e.length)return N();const s=e=>{const{name:t}=e||{};return t?`{{customerLink}}${t}{{/customerLink}}`:""},n=e=>{const{id:o,number:n,customer_id:r}=e,i=t.find((e=>e.user_id===r))||{};let c=null;return i&&i.id&&(c=window.wcAdminFeatures.analytics?(0,y.getNewPath)({},"/analytics/customers",{filter:"single_customer",customers:i.id}):(0,x.getAdminLink)("user-edit.php?user_id="+i.id)),(0,b.jsx)(b.Fragment,{children:(0,v.Z)({mixedString:(0,m.sprintf)((0,m.__)("{{orderLink}}Order #%(orderNumber)s{{/orderLink}} %(customerString)s","woocommerce"),{orderNumber:n,customerString:s(i)}),components:{orderLink:(0,b.jsx)(p.Link,{href:(0,x.getAdminLink)("post.php?action=edit&post="+o),onClick:()=>S("order_number"),type:"wp-admin"}),destinationFlag:i&&i.country?(0,b.jsx)(p.Flag,{code:i&&i.country,round:!1}):null,customerLink:c?(0,b.jsx)(p.Link,{href:c,onClick:()=>S("customer_name"),type:"wc-admin"}):(0,b.jsx)("span",{})}})})},r=[];return e.forEach((e=>{const{date_created_gmt:t,line_items:s,id:i}=e,c=s?s.length:0;r.push((0,b.jsx)(f.U,{className:"woocommerce-order-activity-card",title:n(e),date:t,onClick:({target:e})=>{S("orders_begin_fulfillment"),e.href||(window.location.href=(0,x.getAdminLink)(`post.php?action=edit&post=${i}`))},subtitle:(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{children:(0,m.sprintf)((0,m._n)("%d product","%d products",c,"woocommerce"),c)}),(0,b.jsx)("span",{children:o(e.total,e.currency)})]}),children:(0,b.jsx)(p.OrderStatus,{order:e,orderStatusMap:(0,C.O3)("orderStatuses",{})})},i))})),(0,b.jsxs)(b.Fragment,{children:[r,(0,b.jsx)(p.Link,{href:"edit.php?post_type=shop_order",className:"woocommerce-layout__activity-panel-outbound-link",onClick:()=>S("orders_manage"),type:"wp-admin",children:(0,m.__)("Manage all orders","woocommerce")})]})}function T({unreadOrdersCount:e,orderStatuses:t}){const o=(0,s.useMemo)((()=>({page:1,per_page:5,status:t,_fields:["id","number","currency","status","total","customer","line_items","customer_id","date_created_gmt"]})),[t]),n=(0,s.useContext)(j.CurrencyContext),i=n.getCurrencyConfig(),{currencySymbols:c={}}=(0,C.O3)("onboarding",{}),{orders:a=[],isRequesting:d,isError:u,customerItems:_}=(0,r.useSelect)((s=>{const{getOrders:n,hasFinishedResolution:r,getOrdersError:i}=s(l.ORDERS_STORE_NAME),{getItems:c}=s(l.ITEMS_STORE_NAME);if(!t.length&&0===e)return{isRequesting:!1};const a=n(o,null),m=r("getOrders",[o]);if(m||null===e||null===a)return{isError:Boolean(i(o)),isRequesting:!0,orderStatuses:t};const d=c("customers",{users:a.map((e=>e.customer_id)).filter((e=>0!==e)),_fields:["id","name","country","user_id"]});return{orders:a,isError:Boolean(i(a)),isRequesting:m,orderStatuses:t,customerItems:d}}));if(u){if(!t.length&&window.wcAdminFeatures.analytics)return(0,b.jsx)(p.EmptyContent,{title:(0,m.__)("You currently don’t have any actionable statuses. To display orders here, select orders that require further review in settings.","woocommerce"),actionLabel:(0,m.__)("Settings","woocommerce"),actionURL:(0,x.getAdminLink)("admin.php?page=wc-admin&path=/analytics/settings")});throw new Error("Failed to load orders, raise error to trigger ErrorBoundary")}const h=_?Array.from(_,(([,e])=>e)):[];return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(p.Section,{children:d?(0,b.jsx)(f.e,{className:"woocommerce-order-activity-card",hasAction:!0,hasDate:!0,lines:1}):E(a,h,((e,t)=>{if(!t)return null;if(i&&i.code===t)return n.formatAmount(e);const o=c[t];return o?(0,j.CurrencyFactory)({...i,symbol:(0,k.decodeEntities)(o),code:t}).formatAmount(e):`${t}${e}`}))})})}T.propTypes={unreadOrdersCount:a().number,orderStatuses:a().array};const R=T;var A=o(39630),L=o(76292),P=o.n(L);class M extends s.Component{constructor(e){super(e),this.state={quantity:e.product.stock_quantity,editing:!1,edited:!1},this.beginEdit=this.beginEdit.bind(this),this.cancelEdit=this.cancelEdit.bind(this),this.onQuantityChange=this.onQuantityChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.onSubmit=this.onSubmit.bind(this)}recordStockEvent(e,t={}){(0,h.recordEvent)(`activity_panel_stock_${e}`,t)}beginEdit(){const{product:e}=this.props;this.setState({editing:!0,quantity:e.stock_quantity},(()=>{this.quantityInput&&this.quantityInput.focus()})),this.recordStockEvent("update_stock")}cancelEdit(){const{product:e}=this.props;this.setState({editing:!1,quantity:e.stock_quantity}),this.recordStockEvent("cancel")}handleKeyDown(e){e.keyCode===A.ESCAPE&&this.cancelEdit()}onQuantityChange(e){this.setState({quantity:e.target.value})}async onSubmit(){const{product:e,updateProductStock:t,createNotice:o}=this.props,s=parseInt(this.state.quantity,10);e.stock_quantity!==s?(this.setState({editing:!1,edited:!0}),await t(e,s)?o("success",(0,m.sprintf)((0,m.__)("%s stock updated","woocommerce"),e.name),{actions:[{label:(0,m.__)("Undo","woocommerce"),onClick:()=>{t(e,e.stock_quantity),this.recordStockEvent("undo")}}]}):o("error",(0,m.sprintf)((0,m.__)("%s stock could not be updated","woocommerce"),e.name)),this.recordStockEvent("save",{quantity:s})):this.setState({editing:!1})}getActions(){const{editing:e}=this.state;return e?[(0,b.jsx)(_.Button,{type:"submit",isPrimary:!0,children:(0,m.__)("Save","woocommerce")},"save"),(0,b.jsx)(_.Button,{type:"reset",children:(0,m.__)("Cancel","woocommerce")},"cancel")]:[(0,b.jsx)(_.Button,{isSecondary:!0,onClick:this.beginEdit,children:(0,m.__)("Update stock","woocommerce")},"update")]}getBody(){const{product:e}=this.props,{editing:t,quantity:o}=this.state;return t?(0,b.jsxs)(s.Fragment,{children:[(0,b.jsx)(_.BaseControl,{className:"woocommerce-stock-activity-card__edit-quantity",children:(0,b.jsx)("input",{className:"components-text-control__input",type:"number",value:o,onKeyDown:this.handleKeyDown,onChange:this.onQuantityChange,ref:e=>{this.quantityInput=e}})}),(0,b.jsx)("span",{children:(0,m.__)("in stock","woocommerce")})]}):(0,b.jsx)("span",{className:(0,i.Z)("woocommerce-stock-activity-card__stock-quantity",{"out-of-stock":e.stock_quantity<1}),children:(0,m.sprintf)((0,m.__)("%d in stock","woocommerce"),e.stock_quantity)})}render(){const{product:e}=this.props,{edited:t,editing:o}=this.state,s=(0,C.O3)("notifyLowStockAmount",0),n=Number.isFinite(e.low_stock_amount)?e.low_stock_amount:s,r=e.stock_quantity<=n,c=e.last_order_date?(0,m.sprintf)((0,m.__)("Last ordered %s","woocommerce"),P().utc(e.last_order_date).fromNow()):null;if(!r&&!t)return null;const a=(0,b.jsx)(p.Link,{href:"post.php?action=edit&post="+(e.parent_id||e.id),onClick:()=>this.recordStockEvent("product_name"),type:"wp-admin",children:e.name});let l=null;"variation"===e.type&&(l=Object.values(e.attributes).map((e=>e.option)).join(", "));const d=(0,w.get)(e,["images",0])||(0,w.get)(e,["image"]),u=(0,i.Z)("woocommerce-stock-activity-card__image-overlay__product",{"is-placeholder":!d||!d.src}),_=(0,b.jsx)("div",{className:"woocommerce-stock-activity-card__image-overlay",children:(0,b.jsx)("div",{className:u,children:(0,b.jsx)(p.ProductImage,{product:e})})}),h=(0,i.Z)("woocommerce-stock-activity-card",{"is-dimmed":!o&&!r}),g=(0,b.jsx)(f.U,{className:h,title:a,subtitle:l,icon:_,date:c,actions:this.getActions(),children:this.getBody()});return o?(0,b.jsx)("form",{onReset:this.cancelEdit,onSubmit:this.onSubmit,children:g}):g}}const I={page:1,per_page:5,status:"publish",_fields:["attributes","id","images","last_order_date","low_stock_amount","name","parent_id","stock_quantity","type"]};class O extends s.Component{constructor(e){super(e),this.updateStock=this.updateStock.bind(this)}async updateStock(e,t){const{invalidateResolution:o,updateProductStock:s}=this.props,n=await s(e,t);return n&&(o("getItems",["products/low-in-stock",I]),o("getItemsTotalCount",["products/count-low-in-stock",g.Ox,null])),n}renderProducts(){const{products:e,createNotice:t}=this.props;return e.map((e=>(0,b.jsx)(M,{product:e,updateProductStock:this.updateStock,createNotice:t},e.id)))}render(){const{lowStockProductsCount:e,isError:t,isRequesting:o,products:s}=this.props;if(t)throw new Error("Failed to load low stock products, Raise error to trigger ErrorBoundary");if(o||!s.length){const t=Math.min(5,null!=e?e:1),o=Array.from(new Array(t)).map(((e,t)=>(0,b.jsx)(f.e,{className:"woocommerce-stock-activity-card",hasAction:!0,lines:1},t)));return(0,b.jsx)(p.Section,{children:o})}return(0,b.jsx)(p.Section,{children:this.renderProducts()})}}O.propTypes={lowStockProductsCount:a().number,products:a().array.isRequired,isError:a().bool,isRequesting:a().bool},O.defaultProps={products:[],isError:!1,isRequesting:!1};const D=(0,n.compose)((0,r.withSelect)((e=>{const{getItems:t,getItemsError:o,isResolving:s}=e(l.ITEMS_STORE_NAME);return{products:Array.from(t("products/low-in-stock",I).values()),isError:Boolean(o("products/low-in-stock",I)),isRequesting:s("getItems",["products/low-in-stock",I])}})),(0,r.withDispatch)((e=>{const{invalidateResolution:t,updateProductStock:o}=e(l.ITEMS_STORE_NAME),{createNotice:s}=e("core/notices");return{createNotice:s,invalidateResolution:t,updateProductStock:o}})))(O);var U=o(9898),F=o(91621);const Z=()=>(0,b.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,b.jsx)("mask",{id:"mask0",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"1",y:"1",width:"14",height:"14",children:(0,b.jsx)("path",{d:"M7.99992 1.33301C4.31992 1.33301 1.33325 4.31967 1.33325 7.99967C1.33325 11.6797 4.31992 14.6663 7.99992 14.6663C11.6799 14.6663 14.6666 11.6797 14.6666 7.99967C14.6666 4.31967 11.6799 1.33301 7.99992 1.33301ZM7.99992 13.333C5.05992 13.333 2.66659 10.9397 2.66659 7.99967C2.66659 5.05967 5.05992 2.66634 7.99992 2.66634C10.9399 2.66634 13.3333 5.05967 13.3333 7.99967C13.3333 10.9397 10.9399 13.333 7.99992 13.333ZM6.66658 9.44634L11.0599 5.05301L11.9999 5.99967L6.66658 11.333L3.99992 8.66634L4.93992 7.72634L6.66658 9.44634Z",fill:"white"})}),(0,b.jsx)("g",{mask:"url(#mask0)",children:(0,b.jsx)("rect",{width:"16",height:"16",fill:"#4AB866"})})]});var B=o(9845),q=o(68744);const H={page:1,per_page:q.X6,status:"hold",_embed:1};class W extends s.Component{recordReviewEvent(e,t){(0,h.recordEvent)(`reviews_${e}`,t||{})}deleteReview(e){const{deleteReview:t,createNotice:o,updateReview:s,clearReviewsCache:n}=this.props;e&&t(e).then((()=>{n(),o("success",(0,m.__)("Review successfully deleted.","woocommerce"),{actions:[{label:(0,m.__)("Undo","woocommerce"),onClick:()=>{s(e,{status:"untrash"},{_embed:1}).then((()=>n()))}}]})})).catch((()=>{o("error",(0,m.__)("Review could not be deleted.","woocommerce"))}))}updateReviewStatus(e,t,o){const{createNotice:s,updateReview:n,clearReviewsCache:r}=this.props;e&&n(e,{status:t}).then((()=>{r(),s("success",(0,m.__)("Review successfully updated.","woocommerce"),{actions:[{label:(0,m.__)("Undo","woocommerce"),onClick:()=>{n(e,{status:o},{_embed:1}).then((()=>r()))}}]})})).catch((()=>{s("error",(0,m.__)("Review could not be updated.","woocommerce"))}))}renderReview(e){const t=e&&e._embedded&&e._embedded.up&&e._embedded.up[0]||null;if(e.isUpdating)return(0,b.jsx)(f.e,{className:"woocommerce-review-activity-card",hasAction:!0,hasDate:!0,lines:1},e.id);if((0,w.isNull)(t)||e.status!==H.status)return null;const o=(0,v.Z)({mixedString:(0,m.sprintf)((0,m.__)("{{authorLink}}%1$s{{/authorLink}}{{verifiedCustomerIcon/}} reviewed {{productLink}}%2$s{{/productLink}}","woocommerce"),e.reviewer,t.name),components:{productLink:(0,b.jsx)(p.Link,{href:t.permalink,onClick:()=>this.recordReviewEvent("product"),type:"external"}),authorLink:(0,b.jsx)(p.Link,{href:(0,x.getAdminLink)("admin.php?page=wc-admin&path=%2Fcustomers&search="+e.reviewer),onClick:()=>this.recordReviewEvent("customer"),type:"external"}),verifiedCustomerIcon:e.verified?(0,b.jsx)("span",{className:"woocommerce-review-activity-card__verified",children:(0,b.jsx)(_.Tooltip,{text:(0,m.__)("Verified owner","woocommerce"),children:(0,b.jsx)("span",{children:(0,b.jsx)(Z,{})})})}):null}}),n=(0,b.jsx)(s.Fragment,{children:(0,b.jsx)(p.ReviewRating,{review:e,icon:F.Z,outlineIcon:U.Z,size:13})}),r=(0,w.get)(t,["images",0])||(0,w.get)(t,["image"]),c=(0,i.Z)("woocommerce-review-activity-card__image-overlay__product",{"is-placeholder":!r||!r.src}),a=(0,b.jsx)("div",{className:"woocommerce-review-activity-card__image-overlay",children:(0,b.jsx)("div",{className:c,children:(0,b.jsx)(p.ProductImage,{product:t,width:33})})}),l={date:e.date_created_gmt,status:e.status},d=[(0,b.jsx)(_.Button,{isSecondary:!0,onClick:()=>{this.recordReviewEvent("approve",l),this.updateReviewStatus(e.id,"approved",e.status)},children:(0,m.__)("Approve","woocommerce")},"approve-action"),(0,b.jsx)(_.Button,{isTertiary:!0,onClick:()=>{this.recordReviewEvent("mark_as_spam",l),this.updateReviewStatus(e.id,"spam",e.status)},children:(0,m.__)("Mark as spam","woocommerce")},"spam-action"),(0,b.jsx)(_.Button,{isDestructive:!0,isTertiary:!0,onClick:()=>{this.recordReviewEvent("delete",l),this.deleteReview(e.id)},children:(0,m.__)("Delete","woocommerce")},"delete-action")];return(0,b.jsx)(f.U,{className:"woocommerce-review-activity-card",title:o,subtitle:n,date:e.date_created_gmt,icon:a,actions:d,children:(0,b.jsx)("span",{dangerouslySetInnerHTML:(0,B.ZP)(e.review)})},e.id)}renderReviews(e){const t=e.map((e=>this.renderReview(e,this.props)));return 0===t.filter(Boolean).length?(0,b.jsx)(b.Fragment,{}):(0,b.jsxs)(b.Fragment,{children:[t,(0,b.jsx)(p.Link,{href:(0,x.getAdminLink)("edit.php?post_type=product&page=product-reviews"),onClick:()=>this.recordReviewEvent("reviews_manage"),className:"woocommerce-layout__activity-panel-outbound-link woocommerce-layout__activity-panel-empty",type:"wp-admin",children:(0,m.__)("Manage all reviews","woocommerce")})]})}render(){const{isRequesting:e,isError:t,reviews:o}=this.props;if(t)throw new Error("Failed to load reviews, Raise error to trigger ErrorBoundary");return(0,b.jsx)(s.Fragment,{children:(0,b.jsx)(p.Section,{children:e||!o.length?(0,b.jsx)(f.e,{className:"woocommerce-review-activity-card",hasAction:!0,hasDate:!0,lines:1}):(0,b.jsx)(b.Fragment,{children:this.renderReviews(o)})})})}}W.propTypes={reviews:a().array.isRequired,isError:a().bool,isRequesting:a().bool},W.defaultProps={reviews:[],isError:!1,isRequesting:!1},W.contextType=j.CurrencyContext;const z=(0,n.compose)([(0,r.withSelect)(((e,t)=>{const{hasUnapprovedReviews:o}=t,{getReviews:s,getReviewsError:n,isResolving:r}=e(l.REVIEWS_STORE_NAME);let i=[],c=!1,a=!1;return o&&(i=s(H),c=Boolean(n(H)),a=r("getReviews",[H])),{reviews:i,isError:c,isRequesting:a}})),(0,r.withDispatch)(((e,t)=>{const{deleteReview:o,updateReview:s,invalidateResolution:n}=e(l.REVIEWS_STORE_NAME),{createNotice:r}=e("core/notices");return{deleteReview:o,createNotice:r,updateReview:s,clearReviewsCache:()=>{n("getReviews",[H]),t.reviews&&t.reviews.length<2&&n("getReviewsTotalCount",[q.wY])}}}))])(W);var G=o(21464);const V={_fields:["id"]},$={status:"publish",_fields:["id"]},J=()=>{const e=(0,r.useSelect)((e=>{const{getOrdersTotalCount:t,hasFinishedResolution:o}=e(l.ORDERS_STORE_NAME),{getProductsTotalCount:s,hasFinishedResolution:n}=e(l.PRODUCTS_STORE_NAME),r=t(V,0),i=(0,g.sg)(e),c=(0,C.O3)("reviewsEnabled","no"),a=(0,g.xX)(e,i),m=(0,C.O3)("manageStock","no"),d=(0,g.ae)(e),u=(0,q.Vh)(e),p=s($,0),_=!o("getOrdersTotalCount",[V,0])||!n("getProductsTotalCount",[$,0]),h=e(l.ONBOARDING_STORE_NAME).getTaskList("setup");return{loadingOrderAndProductCount:_,lowStockProductsCount:d,unapprovedReviewsCount:u,unreadOrdersCount:a,manageStock:m,isTaskListHidden:h?.isHidden,publishedProductCount:p,reviewsEnabled:c,totalOrderCount:r,orderStatuses:i}})),t=e.loadingOrderAndProductCount?[]:function({lowStockProductsCount:e,unapprovedReviewsCount:t,unreadOrdersCount:o,manageStock:s,isTaskListHidden:n,orderStatuses:r,publishedProductCount:i,reviewsEnabled:c,totalOrderCount:a}){return n?[a>0&&{className:"woocommerce-homescreen-card",count:o,collapsible:!0,id:"orders-panel",initialOpen:!1,panel:(0,b.jsx)(p.__experimentalErrorBoundary,{errorMessage:(0,b.jsxs)(b.Fragment,{children:[(0,m.__)("There was an error getting your orders.","woocommerce"),(0,b.jsx)("br",{}),(0,m.__)("Please try again.","woocommerce")]}),children:(0,b.jsx)(R,{unreadOrdersCount:o,orderStatuses:r})}),title:(0,m.__)("Orders","woocommerce")},a>0&&i>0&&"yes"===s&&{className:"woocommerce-homescreen-card",count:e,id:"stock-panel",initialOpen:!1,collapsible:0!==e,panel:(0,b.jsx)(p.__experimentalErrorBoundary,{errorMessage:(0,b.jsxs)(b.Fragment,{children:[(0,m.__)("There was an error getting your low stock products.","woocommerce"),(0,b.jsx)("br",{}),(0,m.__)("Please try again.","woocommerce")]}),children:(0,b.jsx)(D,{lowStockProductsCount:e})}),title:(0,m.__)("Stock","woocommerce")},i>0&&t>0&&"yes"===c&&{className:"woocommerce-homescreen-card",id:"reviews-panel",count:t,initialOpen:!1,collapsible:0!==t,panel:(0,b.jsx)(p.__experimentalErrorBoundary,{errorMessage:(0,b.jsxs)(b.Fragment,{children:[(0,m.__)("There was an error getting your reviews.","woocommerce"),(0,b.jsx)("br",{}),(0,m.__)("Please try again.","woocommerce")]}),children:(0,b.jsx)(z,{hasUnapprovedReviews:t>0})}),title:(0,m.__)("Reviews","woocommerce")}].filter(Boolean):[]}(e);if((0,s.useEffect)((()=>{if(void 0!==e.isTaskListHidden){const o=t.reduce(((e,t)=>(e[(0,w.snakeCase)(t.id)]=!0,e)),{task_list:e.isTaskListHidden});(0,h.recordEvent)("activity_panel_visible_panels",o)}}),[e.isTaskListHidden]),0===t.length)return null;const o=e=>{const{opened_panel:t}=(0,G.DP)(window.location.search);return e===t};return(0,b.jsx)(_.Panel,{className:"woocommerce-activity-panel",children:t.map((e=>{const{className:t,count:s,id:n,initialOpen:r,panel:i,title:c,collapsible:a}=e;return a?(0,b.jsx)(_.PanelBody,{title:[(0,b.jsx)(_.__experimentalText,{variant:"title.small",size:"20",lineHeight:"28px",children:c},c),null!==s&&(0,b.jsx)(p.Badge,{count:s},`${c}-badge`)],className:t,initialOpen:o(n)||r,collapsible:a,disabled:!a,onToggle:e=>{e&&(0,h.recordEvent)("activity_panel_open",{tab:n})},children:(0,b.jsx)(_.PanelRow,{children:i})},n):(0,b.jsx)("div",{className:"components-panel__body",children:(0,b.jsx)("h2",{className:"components-panel__body-title",children:(0,b.jsxs)(_.Button,{className:"components-panel__body-toggle","aria-expanded":!1,disabled:!0,children:[(0,b.jsx)(_.__experimentalText,{variant:"title.small",size:"20",lineHeight:"28px",children:c}),null!==s&&(0,b.jsx)(p.Badge,{count:s})]})})},n)}))})},Y=({children:e,shouldStick:t=!1})=>{const[o,n]=(0,s.useState)(!1),r=(0,s.useRef)(null),i=(0,s.useRef)(null),c=(0,s.useCallback)((()=>{if(!r.current)return;const{bottom:e,top:t}=r.current.getBoundingClientRect();null===i.current&&(i.current=t);const o=e<window.innerHeight;t===i.current&&n(o)}),[]);return(0,s.useLayoutEffect)((()=>{if(t)return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c)}}),[c,t]),(0,b.jsx)("div",{className:"woocommerce-homescreen-column",ref:r,style:{position:t&&o?"sticky":"static"},children:e})};var K=o(58474),Q=o(14812),X=o(92694);const ee=(0,X.applyFilters)("woocommerce_admin_homepage_default_stats",["revenue/total_sales","revenue/net_revenue","orders/orders_count","products/items_sold","jetpack/stats/visitors","jetpack/stats/views"]),te=["revenue/net_revenue","products/items_sold"];var oe=o(7295);const se=(0,r.withSelect)(((e,{stats:t,query:o})=>(0,oe.A)(e,t,o)))((({stats:e,primaryData:t,secondaryData:o,primaryRequesting:n,secondaryRequesting:r,primaryError:c,secondaryError:a,query:l})=>{const{formatAmount:d,getCurrencyConfig:u}=(0,s.useContext)(j.CurrencyContext);if(c||a)return null;const _=(0,y.getPersistedQuery)(l),w=u();return(0,b.jsx)("ul",{className:(0,i.Z)("woocommerce-stats-overview__stats",{"is-even":e.length%2==0}),children:e.map((e=>{if(n||r)return(0,b.jsx)(p.SummaryNumberPlaceholder,{},e.stat);const{primaryValue:s,secondaryValue:i,delta:c,reportUrl:a,reportUrlType:l}=(0,oe.Z)({indicator:e,primaryData:t,secondaryData:o,currency:w,formatAmount:d,persistedQuery:_});return(0,b.jsx)(p.SummaryNumber,{isHomescreen:!0,href:a,hrefType:l,label:e.label,value:s,prevLabel:(0,m.__)("Previous period:","woocommerce"),prevValue:i,delta:c,onLinkClickCallback:()=>{(0,h.recordEvent)("statsoverview_indicators_click",{key:e.stat})}},e.stat)}))})}));var ne=o(23418);(0,m.__)("Facebook for WooCommerce","woocommerce"),(0,m.__)("Jetpack","woocommerce"),(0,m.__)("Klarna Checkout for WooCommerce","woocommerce"),(0,m.__)("Klarna Payments for WooCommerce","woocommerce"),(0,m.__)("Mailchimp for WooCommerce","woocommerce"),(0,m.__)("Creative Mail for WooCommerce","woocommerce"),(0,m.__)("WooCommerce PayPal","woocommerce"),(0,m.__)("WooCommerce Stripe","woocommerce"),(0,m.__)("WooCommerce Payfast","woocommerce"),(0,m.__)("WooPayments","woocommerce"),(0,m.__)("WooCommerce Shipping & Tax","woocommerce"),(0,m.__)("WooCommerce Shipping & Tax","woocommerce"),(0,m.__)("WooCommerce Shipping & Tax","woocommerce"),(0,m.__)("WooCommerce ShipStation Gateway","woocommerce"),(0,m.__)("Mercado Pago payments for WooCommerce","woocommerce"),(0,m.__)("Google for WooCommerce","woocommerce"),(0,m.__)("Razorpay","woocommerce"),(0,m.__)("MailPoet","woocommerce"),(0,m.__)("Pinterest for WooCommerce","woocommerce"),(0,m.__)("TikTok for WooCommerce","woocommerce"),(0,m.__)("Omnichannel for WooCommerce","woocommerce");const re=r.controls&&r.controls.dispatch?r.controls.dispatch:ne.dispatch;r.controls&&r.controls.resolveSelect?r.controls.resolveSelect:ne.select;const ie=e=>re("core/notices","createNotice","error",e),ce=e=>({unavailable:(0,m.__)("Get Jetpack","woocommerce"),installed:(0,m.__)("Activate Jetpack","woocommerce"),activated:(0,m.__)("Connect Jetpack","woocommerce")}[e]||""),ae=({onClickInstall:e,onClickDismiss:t,isBusy:o,jetpackInstallState:s})=>(0,b.jsxs)("article",{className:"woocommerce-stats-overview__install-jetpack-promo",children:[(0,b.jsxs)("div",{className:"woocommerce-stats-overview__install-jetpack-promo__content",children:[(0,b.jsx)(p.H,{children:(0,m.__)("Get traffic stats with Jetpack","woocommerce")}),(0,b.jsx)("p",{children:(0,m.__)("Keep an eye on your views and visitors metrics with Jetpack. Requires Jetpack plugin and a WordPress.com account.","woocommerce")})]}),(0,b.jsxs)("footer",{children:[(0,b.jsx)(_.Button,{isSecondary:!0,onClick:()=>{(0,h.recordEvent)("statsoverview_install_jetpack"),e()},disabled:o,isBusy:o,children:ce(s)}),(0,b.jsx)(_.Button,{isTertiary:!0,onClick:()=>{(0,h.recordEvent)("statsoverview_dismiss_install_jetpack"),t()},disabled:o,isBusy:o,children:(0,m.__)("No thanks","woocommerce")})]})]}),le=()=>{const{currentUserCan:e}=(0,l.useUser)(),{updateUserPreferences:t,...o}=(0,l.useUserPreferences)(),{canUserInstallPlugins:s,jetpackInstallState:n,isBusy:i}=(0,r.useSelect)((t=>{const{getPluginInstallState:o,isPluginsRequesting:s}=t(l.PLUGINS_STORE_NAME),n=o("jetpack");return{isBusy:s("getJetpackConnectUrl")||s("installPlugins")||s("activatePlugins"),jetpackInstallState:n,canUserInstallPlugins:e("install_plugins")}})),{installJetpackAndConnect:c}=(0,r.useDispatch)(l.PLUGINS_STORE_NAME);return s?(0,b.jsx)(ae,{jetpackInstallState:n,isBusy:i,onClickInstall:()=>{c(ie,x.getAdminLink)},onClickDismiss:()=>{const e=o.homepage_stats||{};e.installJetpackDismissed=!0,t({homepage_stats:e})}}):null},{performanceIndicators:me=[]}=(0,C.O3)("dataEndpoints",{performanceIndicators:[]}),de=me.filter((e=>ee.includes(e.stat))),ue=()=>(0,b.jsx)(Q.Text,{variant:"title.small",size:"20",lineHeight:"28px",children:(0,m.__)("Stats overview","woocommerce")}),pe=()=>{const{updateUserPreferences:e,...t}=(0,l.useUserPreferences)(),o=(0,w.get)(t,["homepage_stats","hiddenStats"],te),n=(0,r.useSelect)((e=>{const t=e(l.PLUGINS_STORE_NAME);return t.isJetpackConnected()&&"activated"===t.getPluginInstallState("jetpack")}),[]),i=(t.homepage_stats||{}).installJetpackDismissed,c=de.filter((e=>!o.includes(e.stat)));return(0,b.jsxs)(_.Card,{size:"large",className:"woocommerce-stats-overview woocommerce-homescreen-card",children:[(0,b.jsxs)(_.CardHeader,{size:"medium",children:[(0,b.jsx)(ue,{}),(0,b.jsx)(p.EllipsisMenu,{label:(0,m.__)("Choose which values to display","woocommerce"),renderContent:()=>(0,b.jsxs)(s.Fragment,{children:[(0,b.jsx)(p.MenuTitle,{children:(0,m.__)("Display stats:","woocommerce")}),de.map((t=>{const s=!o.includes(t.stat);return(0,b.jsx)(p.MenuItem,{checked:s,isCheckbox:!0,isClickable:!0,onInvoke:()=>(t=>{const s=(0,w.xor)(o,[t]);e({homepage_stats:{hiddenStats:s}}),(0,h.recordEvent)("statsoverview_indicators_toggle",{indicator_name:t,status:s.includes(t)?"off":"on"})})(t.stat),children:t.label},t.stat)}))]})})]}),(0,b.jsx)(_.TabPanel,{className:"woocommerce-stats-overview__tabs",onSelect:e=>{(0,h.recordEvent)("statsoverview_date_picker_update",{period:e})},tabs:[{title:(0,m.__)("Today","woocommerce"),name:"today"},{title:(0,m.__)("Week to date","woocommerce"),name:"week"},{title:(0,m.__)("Month to date","woocommerce"),name:"month"}],children:e=>(0,b.jsxs)(s.Fragment,{children:[!n&&!i&&(0,b.jsx)(le,{}),(0,b.jsx)(se,{query:{period:e.name,compare:"previous_period"},stats:c})]})}),(0,b.jsx)(_.CardFooter,{children:(0,b.jsx)(p.Link,{className:"woocommerce-stats-overview__more-btn",href:(0,y.getNewPath)({},"/analytics/overview"),type:"wc-admin",onClick:()=>{(0,h.recordEvent)("statsoverview_indicators_click",{key:"view_detailed_stats"})},children:(0,m.__)("View detailed stats","woocommerce")})})]})};var _e=o(87498),he=o(20849),we=o(19232),ge=o(90728),ke=o(62148),ve=o(47979),ye=o(10865),xe=o(88312);const je=({title:e,children:t})=>(0,b.jsxs)("div",{className:"woocommerce-quick-links__category",children:[(0,b.jsx)("h3",{className:"woocommerce-quick-links__category-header",children:e}),t]});var fe=o(59550),Ce=o(85800);const be=({icon:e,title:t,href:o,linkType:s,onClick:n})=>{const r="external"===s;return(0,b.jsx)("div",{className:"woocommerce-quick-links__item",children:(0,b.jsxs)(p.Link,{onClick:n,href:o,type:s,target:r?"_blank":null,className:"woocommerce-quick-links__item-link",children:[(0,b.jsx)(fe.Z,{className:"woocommerce-quick-links__item-link__icon",icon:e}),(0,b.jsx)(Q.Text,{className:"woocommerce-quick-links__item-link__text",as:"div",variant:"button",weight:"600",size:"14",lineHeight:"20px",children:t}),r&&(0,b.jsx)(fe.Z,{icon:Ce.Z})]})})};function Se({path:e,tab:t=null,type:o,href:s=null}){return{"wc-admin":{href:`admin.php?page=wc-admin&path=%2F${e}`,linkType:"wc-admin"},"wp-admin":{href:e,linkType:"wp-admin"},"wc-settings":{href:`admin.php?page=wc-settings&tab=${t}`,linkType:"wp-admin"}}[o]||{href:s,linkType:"external"}}const Ne=()=>{const e=(0,C.O3)("shopUrl"),t=(0,X.applyFilters)("woocommerce_admin_homescreen_quicklinks",[]).reduce(((e,{icon:t,href:o,title:s})=>(new URL(o,window.location.href).origin===window.location.origin&&e.push({icon:t,link:{href:o,linkType:"wp-admin"},title:s,listItemTag:"quick-links-extension-link"}),e)),[]),o=function(e){return[{title:(0,m.__)("Marketing & Merchandising","woocommerce"),items:[{title:(0,m.__)("Marketing","woocommerce"),link:Se({type:"wc-admin",path:"marketing"}),icon:_e.Z,listItemTag:"marketing"},{title:(0,m.__)("Add products","woocommerce"),link:Se({type:"wp-admin",path:"post-new.php?post_type=product"}),icon:he.Z,listItemTag:"add-products"},{title:(0,m.__)("Personalize my store","woocommerce"),link:Se({type:"wp-admin",path:"customize.php"}),icon:we.Z,listItemTag:"personalize-store"},{title:(0,m.__)("View my store","woocommerce"),link:Se({type:"external",href:e}),icon:ge.Z,listItemTag:"view-store"}]},{title:(0,m.__)("Settings","woocommerce"),items:[{title:(0,m.__)("Store details","woocommerce"),link:Se({type:"wc-settings",tab:"general"}),icon:ke.Z,listItemTag:"edit-store-details"},{title:(0,m.__)("Payments","woocommerce"),link:Se({type:"wc-settings",tab:"checkout"}),icon:ve.Z,listItemTag:"payment-settings"},{title:(0,m.__)("Tax","woocommerce"),link:Se({type:"wc-settings",tab:"tax"}),icon:ye.Z,listItemTag:"tax-settings"},{title:(0,m.__)("Shipping","woocommerce"),link:Se({type:"wc-settings",tab:"shipping"}),icon:xe.Z,listItemTag:"shipping-settings"}]}]}(e),s={title:(0,m.__)("Extensions","woocommerce"),items:t},n=t.length?[...o,s]:o;return(0,b.jsxs)(_.Card,{size:"medium",children:[(0,b.jsx)(_.CardHeader,{size:"medium",children:(0,b.jsx)(Q.Text,{variant:"title.small",size:"20",lineHeight:"28px",children:(0,m.__)("Store management","woocommerce")})}),(0,b.jsx)(_.CardBody,{size:"custom",className:"woocommerce-store-management-links__card-body",children:n.map((e=>(0,b.jsx)(je,{title:e.title,children:e.items.map((({icon:e,listItemTag:t,title:o,link:{href:s,linkType:n}})=>(0,b.jsx)(be,{icon:e,title:o,linkType:n,href:s,onClick:()=>{(0,h.recordEvent)("home_quick_links_click",{task_name:t})}},`${o}_${t}_${s}`)))},e.title)))})]})};var Ee=o(96456),Te=o(83014),Re=o(98817),Ae=o(7637);const Le=o.p+"9a6ad9a6f33d5f8cefde.png",Pe=({body:e,onDismiss:t})=>(0,b.jsxs)("div",{className:"mobile-app-modal-layout",children:[(0,b.jsx)("div",{className:"mobile-app-modal-content",children:e}),(0,b.jsx)("div",{className:"mobile-app-modal-illustration",children:(0,b.jsx)("img",{src:Le,alt:(0,m.__)("Screen captures of the WooCommerce mobile app","woocommerce")})}),(0,b.jsx)(_.Button,{variant:"tertiary",className:"woocommerce__mobile-app-welcome-modal__close-button",label:(0,m.__)("Close","woocommerce"),icon:(0,b.jsx)(_.Icon,{icon:Ae.Z,viewBox:"6 4 12 14"}),iconSize:16,size:16,onClick:t})]}),Me="user-cannot-install",Ie="not-owner-of-connection",Oe="full-connection",De="initializing",Ue=()=>{const{currentUserCan:e}=(0,l.useUser)(),{canUserInstallPlugins:t,jetpackInstallState:o,jetpackConnectionData:n}=(0,r.useSelect)((t=>{const{getPluginInstallState:o,getJetpackConnectionData:s}=t(l.PLUGINS_STORE_NAME),n=o("jetpack");return{jetpackConnectionData:s(),jetpackInstallState:n,canUserInstallPlugins:e("install_plugins")}})),{installJetpackAndConnect:i}=(0,r.useDispatch)(l.PLUGINS_STORE_NAME),[c,a]=(0,s.useState)(De),m=(0,s.useCallback)((()=>{const e=window.location.href;i(ie,(()=>e+"&jetpackState=returning")),a("installing")}),[i]);return(0,s.useEffect)((()=>{if(t)switch(o){case"installed":a("not-activated");break;case"unavailable":a("not-installed");break;case"activated":n&&!n?.connectionOwner?a("userless-connection"):n&&!n?.currentUser?.isMaster?a(Ie):n&&n?.currentUser?.isConnected&&n?.currentUser?.isMaster&&a(Oe)}else a(Me)}),[t,o,n]),{state:c,installHandler:m,jetpackConnectionData:n}};var Fe=o(86989),Ze=o.n(Fe);const Be="fetching",qe="success",He="error",We=({onClickHandler:e,isFetching:t})=>(0,b.jsxs)(_.Button,{className:"send-magic-link-button",onClick:e,children:[t&&(0,b.jsx)(p.Spinner,{className:"send-magic-link-spinner"}),(0,b.jsx)("div",{style:{visibility:t?"hidden":"visible"},className:"send-magic-link-button-contents",children:(0,b.jsx)("div",{className:"send-magic-link-button-text",children:(0,m.__)("✨️ Send the sign-in link","woocommerce")})})]}),ze=({returnToSendLinkPage:e})=>(0,b.jsxs)("div",{className:"email-sent-modal-body",children:[(0,b.jsx)("div",{className:"email-sent-illustration"}),(0,b.jsx)("div",{className:"email-sent-title",children:(0,b.jsx)("h1",{children:(0,m.__)("Check your email!","woocommerce")})}),(0,b.jsx)("div",{className:"email-sent-subheader-spacer",children:(0,b.jsx)("div",{className:"email-sent-subheader",children:(0,m.__)("We just sent you the magic link. Open it on your mobile device and follow the instructions.","woocommerce")})}),(0,b.jsxs)("div",{className:"email-sent-footer",children:[(0,b.jsx)("div",{className:"email-sent-footer-prompt",children:(0,m.__)("DIDN’T GET IT?","woocommerce")}),(0,b.jsx)("div",{className:"email-sent-footer-text",children:(0,v.Z)({mixedString:(0,m.__)("Check your spam/junk email folder or {{ sendAnotherLink /}}.","woocommerce"),components:{sendAnotherLink:(0,b.jsx)(_.Button,{className:"email-sent-send-another-link",onClick:()=>{e()},children:(0,m.__)("send another link","woocommerce")})}})})]})]});o(99196);const Ge=({children:e})=>(0,b.jsxs)("div",{className:"jetpack-installation-content",children:[(0,b.jsxs)("div",{className:"modal-layout-header",children:[(0,b.jsx)("div",{className:"woo-icon"}),(0,b.jsx)("div",{className:"modal-header",children:(0,b.jsx)("h1",{children:(0,m.__)("Manage orders and track sales in real-time with the free mobile app","woocommerce")})})]}),(0,b.jsx)("div",{className:"modal-layout-body",children:e}),(0,b.jsxs)("div",{className:"modal-layout-footer",children:[(0,b.jsxs)("div",{className:"mobile-footer-icons",children:[(0,b.jsx)("div",{className:"apple-icon"}),(0,b.jsx)("div",{className:"android-icon"})]}),(0,b.jsx)("div",{className:"mobile-footer-blurb",children:(0,m.__)("The WooCommerce Mobile App is available on iOS and Android","woocommerce")})]})]});var Ve=o(36833);const $e=()=>(0,b.jsx)("div",{children:(0,b.jsx)(Ve.tv,{value:"https://woocommerce.com/mobile/?utm_source=wc_onboarding_mobile_task",size:140})}),Je=({loginUrl:e})=>(0,b.jsxs)("div",{children:[e&&(0,b.jsxs)("div",{children:[(0,b.jsx)(Ve.tv,{value:e,size:140}),(0,b.jsx)("p",{children:(0,m.__)("The app version needs to be 15.7 or above to sign in with this link.","woocommerce")})]}),(0,b.jsx)("div",{children:(0,v.Z)({mixedString:(0,m.__)("Any troubles signing in? Check out the {{link}}FAQ{{/link}}.","woocommerce"),components:{link:(0,b.jsx)(p.Link,{href:"https://woocommerce.com/document/android-ios-apps-login-help-faq/",target:"_blank",type:"external",onClick:()=>{(0,h.recordEvent)("onboarding_app_login_faq_click")}}),strong:(0,b.jsx)("strong",{})}})})]}),Ye=({step:e,isJetpackPluginInstalled:t,wordpressAccountEmailAddress:o,completeInstallationStepHandler:n,sendMagicLinkHandler:r,sendMagicLinkStatus:i})=>{const[c,a]=(0,s.useState)(void 0);return(0,s.useEffect)((()=>{if("first"===e)a([{key:"first",label:(0,m.__)("Install the mobile app","woocommerce"),description:(0,m.__)("Scan the code below to download or upgrade the app, or visit woo.com/mobile from your mobile device.","woocommerce"),content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)($e,{}),(0,b.jsx)(_.Button,{variant:"primary",className:"install-app-button",onClick:()=>{n()},children:(0,m.__)("App is installed","woocommerce")})]})},{key:"second",label:(0,m.__)("Sign into the app","woocommerce"),description:"",content:(0,b.jsx)(b.Fragment,{})}]);else if("second"===e)if(t&&void 0!==o)a([{key:"first",label:(0,m.__)("App installed","woocommerce"),description:"",content:(0,b.jsx)(b.Fragment,{})},{key:"second",label:"Sign into the app",description:(0,m.sprintf)((0,m.__)("We’ll send a magic link to %s. Open it on your smartphone or tablet to sign into your store instantly.","woocommerce"),o),content:(0,b.jsx)(We,{isFetching:i===Be,onClickHandler:r})}]);else{const e=(0,C.O3)("siteUrl"),t=(0,C.O3)("currentUserData").username,o=`woocommerce://app-login?siteUrl=${encodeURIComponent(e)}&username=${encodeURIComponent(t)}`,s=o?(0,m.__)("Scan the QR code below and enter the wp-admin password in the app.","woocommerce"):(0,m.__)("Follow the instructions in the app to sign in.","woocommerce");a([{key:"first",label:(0,m.__)("App installed","woocommerce"),description:"",content:(0,b.jsx)(b.Fragment,{})},{key:"second",label:"Sign into the app",description:s,content:(0,b.jsx)(Je,{loginUrl:o})}])}}),[e,t,o,n,r,i]),(0,b.jsx)("div",{className:"login-stepper-wrapper",children:c&&(0,b.jsx)(p.Stepper,{isVertical:!0,currentStep:e,steps:c})})},Ke=({appInstalledClicked:e,isJetpackPluginInstalled:t,wordpressAccountEmailAddress:o,completeInstallationHandler:s,sendMagicLinkHandler:n,sendMagicLinkStatus:r})=>(0,b.jsxs)(Ge,{children:[(0,b.jsx)("div",{className:"modal-subheader",children:(0,b.jsx)("h3",{children:(0,m.__)("Run your store from anywhere in two easy steps.","woocommerce")})}),(0,b.jsx)(Ye,{step:e?"second":"first",isJetpackPluginInstalled:t,wordpressAccountEmailAddress:o,completeInstallationStepHandler:s,sendMagicLinkHandler:n,sendMagicLinkStatus:r})]});var Qe=o(30655);const Xe=()=>{const[e,t]=(0,s.useState)(!1),[o,n]=(0,s.useState)(!1),{state:i,jetpackConnectionData:c}=Ue(),{updateOptions:a}=(0,r.useDispatch)(l.OPTIONS_STORE_NAME),[d,u]=(0,s.useState)(),[p]=(0,Te.lr)(),{invalidateResolutionForStoreSelector:w}=(0,r.useDispatch)(l.ONBOARDING_STORE_NAME);(0,s.useEffect)((()=>{p.get("mobileAppModal")?t(!0):t(!1),"returning"===p.get("jetpackState")&&n(!0)}),[p]);const[g,k]=(0,s.useState)(!1),[v,x]=(0,s.useState)(!1),[j,f]=(0,s.useState)(!1),{requestState:C,fetchMagicLinkApiCall:S}=(()=>{const[e,t]=(0,s.useState)("initializing"),{createNotice:o}=(0,r.useDispatch)("core/notices");return{requestState:e,fetchMagicLinkApiCall:(0,s.useCallback)((()=>{t(Be),Ze()({path:`${l.WC_ADMIN_NAMESPACE}/mobile-app/send-magic-link`}).then((e=>{"success"===e.code?t(qe):(t(He),o("error",(0,m.__)("Sorry, an unknown error occurred.","woocommerce")))})).catch((e=>{t(He),(0,h.recordEvent)("magic_prompt_send_magic_link_error",{error:e.message,code:e.code}),"error_sending_mobile_magic_link"===e.code?o("error",(0,m.__)("We couldn’t send the link. Try again in a few seconds.","woocommerce")):"invalid_user_permission_view_admin"===e.code?o("error",(0,m.__)("Sorry, your account doesn’t have sufficient permission.","woocommerce")):"jetpack_not_connected"===e.code?o("error",e.message):o("error","We couldn’t send the link. Try again in a few seconds.")}))}),[o])}})(),N=(0,s.useCallback)((()=>{k(!0),(0,h.recordEvent)("onboarding_app_install_click")}),[]),E=(0,s.useCallback)((()=>{S(),(0,h.recordEvent)("magic_prompt_send_signin_link_click")}),[S]);(0,s.useEffect)((()=>{C===qe&&x(!0)}),[C]),(0,s.useEffect)((()=>{if(v)u((0,b.jsx)(ze,{returnToSendLinkPage:()=>{x(!1),f(!0),(0,h.recordEvent)("magic_prompt_retry_send_signin_link")}}));else{var e;const t=null!==(e=i===Oe&&void 0!==c?.currentUser?.wpcomUser?.email)&&void 0!==e&&e,o=c?.currentUser?.wpcomUser?.email;u((0,b.jsx)(Ke,{appInstalledClicked:g,isJetpackPluginInstalled:t,wordpressAccountEmailAddress:o,completeInstallationHandler:N,sendMagicLinkHandler:E,sendMagicLinkStatus:C}))}}),[g,E,v,o,c?.currentUser?.wpcomUser?.email,i,j,C,N]);const T=(0,s.useCallback)((()=>{(0,y.updateQueryString)({jetpackState:void 0,mobileAppModal:void 0},void 0,Object.fromEntries(p.entries()))}),[p]),R=()=>{a({woocommerce_admin_dismissed_mobile_app_modal:"yes"}).then((()=>w("getTaskLists"))),T(),t(!1)};return(0,b.jsx)(b.Fragment,{children:e&&(0,b.jsx)(_.Guide,{onFinish:R,className:"woocommerce__mobile-app-welcome-modal",pages:[{content:(0,b.jsx)(Pe,{body:d,onDismiss:R})}]})})},et="wc/admin/mobile-app-help-entry-callback";(0,Re.registerPlugin)("woocommerce-mobile-app-modal",{render:()=>{const{state:e}=Ue(),t=(0,s.useCallback)((t=>e===De||e===Me||e===Ie?t:[...t,{title:(0,m.__)("Get the WooCommerce app","woocommerce"),link:(0,x.getAdminLink)("./admin.php?page=wc-admin&mobileAppModal=true"),linkType:"wc-admin"}]),[e]);return(0,s.useEffect)((()=>{(0,X.removeFilter)(Qe.SETUP_TASK_HELP_ITEMS_FILTER,et),(0,X.addFilter)(Qe.SETUP_TASK_HELP_ITEMS_FILTER,et,t,10)}),[t]),null},scope:"woocommerce-admin"});const tt="woocommerce_homescreen_experimental_header_banner_item",ot=({children:e,order:t=1})=>(0,b.jsx)(_.Fill,{name:tt,children:o=>(0,p.createOrderedChildren)(e,t,o)});ot.Slot=({fillProps:e})=>(0,b.jsx)(_.Slot,{name:tt,fillProps:e,children:p.sortFillsByOrder});const st=({className:e})=>{const t=(0,Q.useSlot)(tt);return Boolean(t?.fills?.length)?(0,b.jsx)("div",{className:(0,i.Z)("woocommerce-homescreen__header",e),children:(0,b.jsx)(ot.Slot,{})}):null},nt="experimental_woocommerce_wcpay_feature",rt=({children:e,order:t=1})=>(0,b.jsx)(_.Fill,{name:nt,children:o=>(0,p.createOrderedChildren)(e,t,o)});rt.Slot=({fillProps:e})=>(0,b.jsx)(_.Slot,{name:nt,fillProps:e,children:p.sortFillsByOrder});const it=({className:e})=>{const t=(0,Q.useSlot)(nt);return Boolean(t?.fills?.length)?(0,b.jsx)("div",{className:(0,i.Z)("woocommerce-homescreen__header",e),children:(0,b.jsx)(rt.Slot,{})}):null},ct=(0,s.lazy)((()=>Promise.resolve().then(o.bind(o,96456)).then((e=>({default:e.TaskLists}))))),at=(e,t,o,s)=>{const n=o||s||window.wcAdminFeatures.analytics;return"two_columns"===(e||t)&&n},lt=({defaultHomescreenLayout:e,query:t,taskListComplete:o,hasTaskList:n,showingProgressHeader:r,isLoadingTaskLists:c,isTaskListHidden:a})=>{var p;const _=(0,l.useUserPreferences)(),h=o||a,w=o||a,g=Object.keys(t).length>0&&!t.task,k=(0,Ee.useActiveSetupTasklist)(),v=at(_.homepage_layout,e,o,a),y=(0,s.useRef)(!0),x=(0,s.useCallback)((()=>{y.current=window.innerWidth>=782}),[]);(0,s.useLayoutEffect)((()=>(x(),window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)})),[x]);const j=y.current&&v,f=null!==(p=t.mobileAppModal)&&void 0!==p&&p,C=()=>(0,b.jsxs)(s.Suspense,{fallback:(0,b.jsx)(Ee.TasksPlaceholder,{query:t}),children:[k&&g&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(Ee.ProgressTitle,{taskListId:k})}),(0,b.jsx)(ct,{query:t})]});return(0,b.jsxs)(b.Fragment,{children:[g&&(0,b.jsx)(st,{className:(0,i.Z)("woocommerce-homescreen",{"woocommerce-homescreen-column":!v})}),(0,b.jsxs)("div",{className:(0,i.Z)("woocommerce-homescreen",{"two-columns":v}),children:[g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(Y,{shouldStick:j,children:[!c&&!r&&(0,b.jsx)(d.Z,{className:"your-store-today",title:(0,m.__)("Your store today","woocommerce"),subtitle:(0,m.__)("To-dos, tips, and insights for your business","woocommerce")}),w&&(0,b.jsx)(it,{}),a&&(0,b.jsx)(J,{}),n&&C(),(0,b.jsx)(u.Z,{format:"promo-card"}),(0,b.jsx)(K.Z,{})]}),(0,b.jsxs)(Y,{shouldStick:j,children:[window.wcAdminFeatures.analytics&&(0,b.jsx)(pe,{}),h&&(0,b.jsx)(Ne,{})]})]}):C(),f&&(0,b.jsx)(Xe,{})]})]})};lt.propTypes={taskListComplete:a().bool,hasTaskList:a().bool,query:a().object.isRequired,shouldShowWelcomeModal:a().bool,shouldShowWelcomeFromCalypsoModal:a().bool};const mt=(0,n.compose)((0,r.withSelect)((e=>{const{isNotesRequesting:t}=e(l.NOTES_STORE_NAME),{getOption:o}=e(l.OPTIONS_STORE_NAME),{getTaskList:s,getTaskLists:n,hasFinishedResolution:r}=e(l.ONBOARDING_STORE_NAME),i=n(),c=!r("getTaskLists");return{defaultHomescreenLayout:o("woocommerce_default_homepage_layout")||"single_column",isBatchUpdating:t("batchUpdateNotes"),isLoadingTaskLists:c,isTaskListHidden:s("setup")?.isHidden,hasTaskList:(0,C.O3)("visibleTaskListIds",[]).length>0,showingProgressHeader:!!i.find((e=>e.isVisible&&e.displayProgressHeader)),taskListComplete:s("setup")?.isComplete}})))(lt)},58474:(e,t,o)=>{o.d(t,{Z:()=>S});var s=o(65736),n=o(69307),r=o(86020),i=o(55609),c=o(67221),a=o(9818),l=o(14599),m=o(29779),d=o(24058),u=o(14812),p=o(76292),_=o.n(p),h=o(13913),w=o(73909),g=o(21464),k=o(81514);const v=({onClose:e})=>{const{createNotice:t}=(0,a.useDispatch)("core/notices"),{batchUpdateNotes:o,removeAllNotes:n}=(0,a.useDispatch)(c.NOTES_STORE_NAME);return(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(i.Modal,{title:(0,s.__)("Dismiss all messages","woocommerce"),className:"woocommerce-inbox-dismiss-all-modal",onRequestClose:e,children:(0,k.jsxs)("div",{className:"woocommerce-inbox-dismiss-all-modal__wrapper",children:[(0,k.jsx)("div",{className:"woocommerce-usage-modal__message",children:(0,s.__)("Are you sure? Inbox messages will be dismissed forever.","woocommerce")}),(0,k.jsxs)("div",{className:"woocommerce-usage-modal__actions",children:[(0,k.jsx)(i.Button,{onClick:e,children:(0,s.__)("Cancel","woocommerce")}),(0,k.jsx)(i.Button,{isPrimary:!0,onClick:()=>{(async()=>{(0,l.recordEvent)("wcadmin_inbox_action_dismissall",{});try{const e=await n({status:"unactioned"});t("success",(0,s.__)("All messages dismissed","woocommerce"),{actions:[{label:(0,s.__)("Undo","woocommerce"),onClick:()=>{o(e.map((e=>e.id)),{is_deleted:0})}}]})}catch(o){t("error",(0,s.__)("Messages could not be dismissed","woocommerce")),e()}})(),e()},children:(0,s.__)("Yes, dismiss all","woocommerce")})]})]})})})},y={page:1,per_page:5,status:"unactioned",type:c.QUERY_DEFAULTS.noteTypes,orderby:"date",order:"desc",_fields:["id","name","title","content","type","status","actions","date_created","date_created_gmt","layout","image","is_deleted","is_read","locale"]},x=["en_US","en_AU","en_CA","en_GB","en_ZA"],j=_()("2022-01-11","YYYY-MM-DD").valueOf(),f=(e,t)=>{(0,l.recordEvent)("inbox_action_click",{note_name:e.name,note_title:e.title,note_content_inner_link:t})};let C=!1;const b=({hasNotes:e,isBatchUpdating:t,notes:o,onDismiss:n,onNoteActionClick:c,onNoteVisible:a,setShowDismissAllModal:p,showHeader:_=!0,loadMoreNotes:w,allNotesFetched:g,notesHaveResolved:v,unreadNotesCount:x})=>{if(t)return;if(!e)return(0,k.jsx)(h.U,{className:"woocommerce-empty-activity-card",title:(0,s.__)("Your inbox is empty","woocommerce"),icon:!1,children:(0,s.__)("As things begin to happen in your store your inbox will start to fill up. You’ll see things like achievements, new feature announcements, extension recommendations and more!","woocommerce")});C||((0,l.recordEvent)("inbox_panel_view",{total:o.length}),C=!0);const j=Object.keys(o).map((e=>o[e]));return(0,k.jsxs)(i.Card,{size:"large",children:[_&&(0,k.jsxs)(i.CardHeader,{size:"medium",children:[(0,k.jsxs)("div",{className:"woocommerce-inbox-card__header",children:[(0,k.jsx)(u.Text,{size:"20",lineHeight:"28px",variant:"title.small",children:(0,s.__)("Inbox","woocommerce")}),(0,k.jsx)(r.Badge,{count:x})]}),(0,k.jsx)(r.EllipsisMenu,{label:(0,s.__)("Inbox Notes Options","woocommerce"),renderContent:({onToggle:e})=>(0,k.jsx)("div",{className:"woocommerce-inbox-card__section-controls",children:(0,k.jsx)(i.Button,{onClick:()=>{p(!0),e()},children:(0,s.__)("Dismiss all","woocommerce")})})})]}),(0,k.jsx)(m.Z,{role:"menu",children:j.map((e=>{const{id:t,is_deleted:o}=e;return o?null:(0,k.jsx)(d.Z,{timeout:500,classNames:"woocommerce-inbox-message",children:(0,k.jsx)(u.InboxNoteCard,{note:e,onDismiss:n,onNoteActionClick:c,onBodyLinkClick:f,onNoteVisible:a},t)},t)}))}),g?null:v?(0,k.jsx)(i.CardFooter,{className:"woocommerce-inbox-card__footer",size:"medium",children:(0,k.jsx)(i.Button,{isPrimary:!0,onClick:()=>{w()},children:j.length>y.per_page?(0,s.__)("Show more","woocommerce"):(0,s.__)("Show older","woocommerce")})}):(0,k.jsx)(u.InboxNotePlaceholder,{className:"banner message-is-unread"})]})},S=({showHeader:e=!0})=>{const[t,o]=(0,n.useState)(y.per_page),[i,m]=(0,n.useState)(!1),[d,p]=(0,n.useState)([]),[h,f]=(0,n.useState)({}),{createNotice:C}=(0,a.useDispatch)("core/notices"),{removeNote:S,updateNote:N,triggerNoteAction:E,invalidateResolutionForStoreSelector:T}=(0,a.useDispatch)(c.NOTES_STORE_NAME),R=(0,g.GG)(),A=(0,n.useMemo)((()=>({...y,per_page:t})),[t]),{isError:L,notes:P,notesHaveResolved:M,isBatchUpdating:I,unreadNotesCount:O}=(0,a.useSelect)((e=>{const{getNotes:t,getNotesError:o,isNotesRequesting:s,hasFinishedResolution:n}=e(c.NOTES_STORE_NAME);return{notes:t(A),unreadNotesCount:t({...y,is_read:!1,per_page:-1}).length,isError:Boolean(o("getNotes",[A])),isBatchUpdating:s("batchUpdateNotes"),notesHaveResolved:!s("batchUpdateNotes")&&n("getNotes",[A])}}));(0,n.useEffect)((()=>{M&&P.length<t&&m(!0),M&&P.length&&p(P.map((e=>{const t=_()(e.date_created_gmt,"YYYY-MM-DD").valueOf();return x.includes(e.locale)&&t>=j?{...e,content:(0,w.r7)(e.content,320)}:e})))}),[P,M]);const[D,U]=(0,n.useState)(!1);if(L){const e=(0,s.__)("There was an error getting your inbox. Please try again.","woocommerce"),t=(0,s.__)("Reload","woocommerce"),o=()=>{window.location.reload()};return(0,k.jsx)(r.EmptyContent,{title:e,actionLabel:t,actionURL:null,actionCallback:o})}return M&&!d.length?null:(0,k.jsxs)(k.Fragment,{children:[D&&(0,k.jsx)(v,{onClose:()=>{U(!1)}}),(0,k.jsxs)("div",{className:"woocommerce-homepage-notes-wrapper",children:[!M&&!d.length&&(0,k.jsx)(r.Section,{children:(0,k.jsx)(u.InboxNotePlaceholder,{className:"banner message-is-unread"})}),(0,k.jsx)(r.Section,{children:Boolean(d.length)&&b({loadMoreNotes:()=>{(0,l.recordEvent)("inbox_action_load_more",{quantity_shown:d.length}),o(t+10)},hasNotes:(0,w.kS)(d),isBatchUpdating:I,notes:d,onDismiss:async e=>{(0,l.recordEvent)("inbox_action_dismiss",{note_name:e.name,note_title:e.title,note_name_dismiss_all:!1,note_name_dismiss_confirmation:!0,screen:R});const t=e.id;try{await S(t),T("getNotes"),C("success",(0,s.__)("Message dismissed","woocommerce"),{actions:[{label:(0,s.__)("Undo","woocommerce"),onClick:async()=>{await N(t,{is_deleted:0}),T("getNotes")}}]})}catch(e){C("error",(0,s._n)("Message could not be dismissed","Messages could not be dismissed",1,"woocommerce"))}},onNoteActionClick:(e,t)=>{E(e.id,t.id)},onNoteVisible:e=>{h[e.id]||e.is_read||(f({...h,[e.id]:!0}),setTimeout((()=>{N(e.id,{is_read:!0})}),3e3)),(0,l.recordEvent)("inbox_note_view",{note_content:e.content,note_name:e.name,note_title:e.title,note_type:e.type,screen:R})},setShowDismissAllModal:U,showHeader:e,allNotesFetched:i,notesHaveResolved:M,unreadNotesCount:O})})]})]})}},84884:(e,t,o)=>{o.d(t,{Z:()=>p});var s=o(80225),n=o(69307),r=o(33002),i=o(56592),c=o(10865),a=o(59550),l=o(7637),m=o(9845),d=o(81514);const u={info:r.Z,check:i.Z,percent:c.Z};function p(e){const{id:t,description:o,children:r,icon:i,isDismissible:c=!0,variant:p="info",onClose:_,onLoad:h}=e,[w,g]=(0,n.useState)("true"!==localStorage.getItem(`wc-marketplaceNoticeClosed-${t}`));if((0,n.useEffect)((()=>{w&&"function"==typeof h&&h()}),[w]),!w)return null;const k=(0,s.Z)("woocommerce-marketplace__notice",`woocommerce-marketplace__notice--${p}`,{"is-dismissible":c}),v=u[i||"info"],y=(0,s.Z)("woocommerce-marketplace__notice-icon",`woocommerce-marketplace__notice-icon--${p}`);return(0,d.jsxs)("div",{className:k,children:[i&&(0,d.jsx)("span",{className:y,children:(0,d.jsx)(a.Z,{icon:v})}),(0,d.jsxs)("div",{className:"woocommerce-marketplace__notice-content",children:[(0,d.jsx)("p",{className:"woocommerce-marketplace__notice-description",dangerouslySetInnerHTML:(0,m.ZP)(o)}),r&&(0,d.jsx)("div",{className:"woocommerce-marketplace__notice-children",children:r})]}),c&&(0,d.jsx)("button",{className:"woocommerce-marketplace__notice-close","aria-label":"Close",onClick:()=>{g(!1),localStorage.setItem(`wc-marketplaceNoticeClosed-${t}`,"true"),"function"==typeof _&&_()},children:(0,d.jsx)(a.Z,{icon:l.Z})})]})}},22252:(e,t,o)=>{o.d(t,{Z:()=>n});var s=o(81514);function n(){return(0,s.jsxs)("svg",{width:"72",height:"60",viewBox:"0 0 72 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsxs)("g",{clipPath:"url(#clip0_4074_10418)",children:[(0,s.jsx)("path",{d:"M68.5301 33.3144C68.0263 32.1006 66.3348 32.344 65.8443 31.1636C65.3538 29.9832 66.7251 28.9562 66.2213 27.7458C65.7175 26.5354 64.0259 26.7755 63.5355 25.5951C63.045 24.4147 64.4163 23.3877 63.9125 22.1773C63.4087 20.9669 61.7171 21.207 61.2267 20.0266C60.7362 18.8462 62.1075 17.8192 61.6037 16.6088C61.0999 15.395 59.4083 15.6385 58.9179 14.4581C58.4274 13.2777 59.7987 12.2507 59.2949 11.0403C58.7911 9.82652 57.0995 10.0699 56.6091 8.88955C56.1186 7.70915 57.4899 6.68214 56.9861 5.47174C56.4823 4.26134 54.7907 4.50142 54.3003 3.32102C53.8465 2.22733 55.0476 1.11696 54.8274 -0.00341797L0 22.5941C0.5038 23.8079 2.19537 23.5644 2.68582 24.7448C3.17627 25.9252 1.805 26.9522 2.3088 28.1626C2.8126 29.373 4.50417 29.133 4.99462 30.3134C5.48508 31.4937 4.11381 32.5208 4.61761 33.7312C5.12141 34.9416 6.81297 34.7015 7.30343 35.8819C7.79388 37.0623 6.42261 38.0893 6.92641 39.2997C7.43021 40.5134 9.12178 40.27 9.61223 41.4504C10.1027 42.6308 8.73142 43.6578 9.23522 44.8682C9.73902 46.0786 11.4306 45.8385 11.921 47.0189C12.4115 48.1993 11.0402 49.2263 11.544 50.4367C12.0478 51.6471 13.7394 51.4071 14.2298 52.5874C14.6836 53.6811 13.4825 54.7915 13.7027 55.9119L28.1928 49.9232L68.5368 33.3177L68.5301 33.3144Z",fill:"#720EEC"}),(0,s.jsx)("path",{d:"M13.696 55.912L28.1861 49.9234L52.3851 39.9634H7.46021C8.17086 40.4802 9.23852 40.5569 9.60886 41.4539C10.0993 42.6343 8.72805 43.6613 9.23185 44.8717C9.73565 46.0821 11.4272 45.842 11.9177 47.0224C12.4081 48.2028 11.0368 49.2298 11.5406 50.4402C12.0444 51.6506 13.736 51.4105 14.2265 52.5909C14.6802 53.6846 13.4791 54.795 13.6993 55.9154L13.696 55.912Z",fill:"#3C087E"}),(0,s.jsx)("path",{d:"M63.8523 41.9907C63.8523 37.4925 67.499 33.848 71.9998 33.848V23.988H17.873V33.848C22.3739 33.848 26.0206 37.4925 26.0206 41.9907C26.0206 46.4889 22.3739 50.1334 17.873 50.1334V59.9934H71.9998V50.1334C67.499 50.1334 63.8523 46.4889 63.8523 41.9907Z",fill:"#D1C1FF"}),(0,s.jsx)("path",{d:"M35.2527 37.676C35.2527 35.2051 37.0143 33.2878 39.6968 33.2878C42.3793 33.2878 44.1643 35.2051 44.1643 37.676C44.1643 40.1468 42.4026 42.0107 39.6968 42.0107C36.991 42.0107 35.2527 40.1201 35.2527 37.676ZM41.7954 37.676C41.7954 36.2288 40.9046 35.3385 39.6935 35.3385C38.4823 35.3385 37.6182 36.2288 37.6182 37.676C37.6182 39.1231 38.509 39.9601 39.6935 39.9601C40.8779 39.9601 41.7954 39.0664 41.7954 37.676ZM37.9852 51.0704L49.1789 33.5513H51.1774L39.9537 51.0704H37.9819H37.9852ZM44.8983 47.0524C44.8983 44.5849 46.6566 42.641 49.3391 42.641C52.0215 42.641 53.8065 44.5849 53.8065 47.0524C53.8065 49.5199 52.0182 51.3872 49.3391 51.3872C46.6599 51.3872 44.8983 49.4966 44.8983 47.0524ZM51.441 47.0524C51.441 45.6053 50.5468 44.715 49.3357 44.715C48.1246 44.715 47.2605 45.6053 47.2605 47.0524C47.2605 48.4996 48.1279 49.3365 49.3357 49.3365C50.5435 49.3365 51.441 48.4696 51.441 47.0524Z",fill:"#720EEC"})]}),(0,s.jsx)("defs",{children:(0,s.jsx)("clipPath",{id:"clip0_4074_10418",children:(0,s.jsx)("rect",{width:"72",height:"60",fill:"white"})})})]})}},55291:(e,t,o)=>{o.d(t,{Z:()=>d});var s=o(55609),n=o(65736),r=o(69307),i=o(14599),c=o(9845),a=o(22252),l=o(81514);const m={percent:a.Z},d=({promotion:e})=>{var t,o;const a=window.location.pathname+window.location.search,d=()=>JSON.parse(localStorage.getItem("wc-marketplaceDismissedPromos")||"[]"),[u,p]=(0,r.useState)(!d().includes(a));if((0,r.useEffect)((()=>{u&&(0,i.recordEvent)("marketplace_promotion_viewed",{path:a,format:"promo-card"})}),[u]),!u)return null;const _="promo-card"+(e.style?` ${e.style}`:""),h=(0,l.jsxs)("div",{className:"promo-content",children:[(0,l.jsx)("h2",{className:"promo-title",children:e.title?.en_US}),(0,l.jsx)("div",{className:"promo-text",dangerouslySetInnerHTML:(0,c.ZP)(e.content?.en_US)})]}),w=(0,l.jsxs)("div",{className:"promo-links",children:[(0,l.jsx)(s.Button,{className:"promo-cta",href:null!==(t=e.cta_link)&&void 0!==t?t:"",onClick:()=>((0,i.recordEvent)("marketplace_promotion_actioned",{path:a,target_uri:e.cta_link,format:"promo-card"}),!0),children:null!==(o=e.cta_label?.en_US)&&void 0!==o?o:""}),(0,l.jsx)(s.Button,{className:"promo-cta-link",onClick:()=>{p(!1),localStorage.setItem("wc-marketplaceDismissedPromos",JSON.stringify(d().concat(a))),(0,i.recordEvent)("marketplace_promotion_dismissed",{path:a,format:"promo-card"})},children:(0,n.__)("Dismiss","woocommerce")})]});function g(){if(e.icon&&Object.hasOwn(m,e.icon)){const t=m[e.icon];return t?(0,l.jsx)("div",{className:"promo-image",children:(0,r.createElement)(t)}):null}return null}return(0,l.jsx)("div",{className:_,children:"has-background"===e?.style?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"promo-content-links",children:[h,w]}),g()]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"promo-content-image",children:[h,g()]}),w]})})}},87287:(e,t,o)=>{o.d(t,{Z:()=>a});var s=o(14599),n=o(91978),r=o(84884),i=o(55291),c=o(81514);const a=({format:e})=>{var t;if(!window?.wcMarketplace?.promotions||!Array.isArray(window?.wcMarketplace?.promotions))return null;const o=(null!==(t=window?.wcMarketplace?.promotions)&&void 0!==t?t:[]).filter((t=>t.format===e)),a=new URLSearchParams(window.location.search),l=a.get("page"),m=Date.now(),d=decodeURIComponent(a.get("path")||""),u=a.get("tab"),p=window.location.pathname+window.location.search,_=()=>{(0,s.recordEvent)("marketplace_promotion_viewed",{path:p,format:e})},h=()=>{(0,s.recordEvent)("marketplace_promotion_dismissed",{path:p,format:e})};return(0,c.jsx)(c.Fragment,{children:o.map(((e,t)=>{if(!e.pages)return null;if(!e.pages.some((e=>{if(e.pathname)return e.pathname===p;if(!e.path)return!1;const t=e=>e.startsWith("/")?e:`/${e}`,o=t(e.path),s=t(d);return e.page===l&&o===s&&(e.tab?u:!u)})))return null;const o=new Date(e.date_from_gmt).getTime(),s=new Date(e.date_to_gmt).getTime();return m<o||m>s?null:"promo-card"===e.format?(0,c.jsx)(i.Z,{promotion:e},t):"notice"===e.format&&e?.content?(0,c.jsx)(r.Z,{id:null!==(a=e.menu_item_id)&&void 0!==a?a:`promotion-${t}`,description:e.content[n.MV.userLocale]||e.content.en_US,variant:e.style?e.style:"info",icon:e?.icon||"",isDismissible:e.is_dismissible||!1,onLoad:_,onClose:h},t):null;var a}))})}}}]);