芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/woocommerce/assets/client/admin/chunks/marketing-overview.js
"use strict";(self.webpackChunk_wcAdmin_webpackJsonp=self.webpackChunk_wcAdmin_webpackJsonp||[]).push([[1996],{74805:function(e,t,n){n.r(t),n.d(t,{default:function(){return z}});var r=n(69307),o=n(67221),a=n(5267),i=n(65736),s=n(94333),c=n(9818),l=n(7862),m=n.n(l),d=n(55609),g=n(14812),u=n(86020),p=n(14599),h=n(87818);class _ extends r.Component{constructor(e){super(e),this.onActivateClick=this.onActivateClick.bind(this),this.onFinishSetupClick=this.onFinishSetupClick.bind(this)}getLinks(){const{docsUrl:e,settingsUrl:t,supportUrl:n,dashboardUrl:o}=this.props,a=[];return e&&a.push({key:"docs",href:e,text:(0,i.__)("Docs","woocommerce")}),n&&a.push({key:"support",href:n,text:(0,i.__)("Get support","woocommerce")}),t&&a.push({key:"settings",href:t,text:(0,i.__)("Settings","woocommerce")}),o&&a.push({key:"dashboard",href:o,text:(0,i.__)("Dashboard","woocommerce")}),(0,r.createElement)("ul",{className:"woocommerce-marketing-installed-extensions-card__item-links"},a.map((e=>(0,r.createElement)("li",{key:e.key},(0,r.createElement)(u.Link,{href:e.href,type:"external",onClick:this.onLinkClick.bind(this,e)},e.text)))))}onLinkClick(e){const{name:t}=this.props;(0,p.recordEvent)("marketing_installed_options",{name:t,link:e.key})}onActivateClick(){const{activatePlugin:e,name:t}=this.props;(0,p.recordEvent)("marketing_installed_activate",{name:t}),e()}onFinishSetupClick(){const{name:e}=this.props;(0,p.recordEvent)("marketing_installed_finish_setup",{name:e})}getActivateButton(){const{isLoading:e}=this.props;return(0,r.createElement)(h.zx,{isSecondary:!0,onClick:this.onActivateClick,disabled:e},(0,i.__)("Activate","woocommerce"))}getFinishSetupButton(){return(0,r.createElement)(h.zx,{isSecondary:!0,href:this.props.settingsUrl,onClick:this.onFinishSetupClick},(0,i.__)("Finish setup","woocommerce"))}render(){const{name:e,description:t,status:n,slug:o}=this.props;let a=null;switch(n){case"installed":a=this.getActivateButton();break;case"activated":a=this.getFinishSetupButton();break;case"configured":a=this.getLinks()}return(0,r.createElement)("div",{className:"woocommerce-marketing-installed-extensions-card__item"},(0,r.createElement)(h.wq,{product:o}),(0,r.createElement)("div",{className:"woocommerce-marketing-installed-extensions-card__item-text-and-actions"},(0,r.createElement)("div",{className:"woocommerce-marketing-installed-extensions-card__item-text"},(0,r.createElement)("h4",null,e),"configured"===n||(0,r.createElement)("p",{className:"woocommerce-marketing-installed-extensions-card__item-description"},t)),(0,r.createElement)("div",{className:"woocommerce-marketing-installed-extensions-card__item-actions"},a)))}}_.defaultProps={isLoading:!1},_.propTypes={name:m().string.isRequired,slug:m().string.isRequired,description:m().string.isRequired,status:m().string.isRequired,settingsUrl:m().string,docsUrl:m().string,supportUrl:m().string,dashboardUrl:m().string,activatePlugin:m().func.isRequired};var k=_,w=n(51455);class v extends r.Component{activatePlugin(e){const{activateInstalledPlugin:t}=this.props;t(e)}isActivatingPlugin(e){const{activatingPlugins:t}=this.props;return t.includes(e)}render(){const{plugins:e}=this.props;if(0===e.length)return null;const t=(0,i.__)("Installed marketing extensions","woocommerce");return(0,r.createElement)(d.Card,{className:"woocommerce-marketing-installed-extensions-card"},(0,r.createElement)(d.CardHeader,null,(0,r.createElement)(g.Text,{variant:"title.small",size:"20",lineHeight:"28px"},t)),e.map((e=>(0,r.createElement)(k,(0,a.Z)({key:e.slug},e,{activatePlugin:()=>this.activatePlugin(e.slug),isLoading:this.isActivatingPlugin(e.slug)})))))}}v.propTypes={plugins:m().arrayOf(m().object).isRequired,activatingPlugins:m().arrayOf(m().string).isRequired};var E=(0,s.compose)((0,c.withSelect)((e=>{const{getInstalledPlugins:t,getActivatingPlugins:n}=e(w.L);return{plugins:t(),activatingPlugins:n()}})),(0,c.withDispatch)((e=>{const{activateInstalledPlugin:t}=e(w.L);return{activateInstalledPlugin:t}})))(v),y=n(83849),f=n.n(y),b=n(85883);const N=e=>{let{title:t,description:n,url:o,product:a,category:i}=e;const s="woocommerce-marketing-recommended-extensions-item",c=(0,b.C)(o);return"coupons"===i&&"automatewoo"===a&&(a="automatewoo-alt"),(0,r.createElement)("a",{href:c,className:s,onClick:()=>{(0,p.recordEvent)("marketing_recommended_extension",{name:t})}},(0,r.createElement)(h.wq,{product:a}),(0,r.createElement)("div",{className:`${s}__text`},(0,r.createElement)("h4",null,t),(0,r.createElement)("p",null,n)))};N.propTypes={title:m().string.isRequired,description:m().string.isRequired,url:m().string.isRequired,product:m().string.isRequired,category:m().string.isRequired};var x=N,P=()=>{const e="is-loading woocommerce-marketing-recommended-extensions-item";return(0,r.createElement)("div",{className:e,"aria-hidden":"true"},(0,r.createElement)("div",{className:"woocommerce-admin-marketing-product-icon is-placeholder"}),(0,r.createElement)("div",{className:`${e}__text`},(0,r.createElement)("h4",{className:"is-placeholder","aria-hidden":"true"}),(0,r.createElement)("p",null,(0,r.createElement)("span",{className:"is-placeholder"}),(0,r.createElement)("span",{className:"is-placeholder"}),(0,r.createElement)("span",{className:"is-placeholder"}))))},C=n(34135);const O=e=>{let{extensions:t,isLoading:n,title:o,description:i,category:s}=e;if(0===t.length&&!n)return null;const c=s?`woocommerce-marketing-recommended-extensions-card__category-${s}`:"";return(0,r.createElement)(C.Z,{title:o,description:i,className:f()("woocommerce-marketing-recommended-extensions-card",c)},n?(0,r.createElement)("div",{className:f()("woocommerce-marketing-recommended-extensions-card__items","woocommerce-marketing-recommended-extensions-card__items--count-5")},[...Array(5).keys()].map((e=>(0,r.createElement)(P,{key:e})))):(0,r.createElement)("div",{className:f()("woocommerce-marketing-recommended-extensions-card__items",`woocommerce-marketing-recommended-extensions-card__items--count-${t.length}`)},t.map((e=>(0,r.createElement)(x,(0,a.Z)({key:e.product,category:s},e))))))};O.propTypes={extensions:m().arrayOf(m().object).isRequired,isLoading:m().bool.isRequired,title:m().string,description:m().string,category:m().string},O.defaultProps={title:(0,i.__)("Recommended extensions","woocommerce"),description:(0,i.__)("Great marketing requires the right tools. Take your marketing to the next level with our recommended marketing extensions.","woocommerce")};var L=(0,s.compose)((0,c.withSelect)(((e,t)=>{const{getRecommendedPlugins:n,isResolving:r}=e(w.L);return{extensions:n(t.category),isLoading:r("getRecommendedPlugins",[t.category])}})),(0,c.withDispatch)((e=>{const{createNotice:t}=e("core/notices");return{createNotice:t}})))(O),R=e=>{const t="woocommerce-marketing-knowledgebase-card__post";return(0,r.createElement)("div",{className:`is-loading ${t}`,key:e,"aria-hidden":"true"},(0,r.createElement)("div",{className:`${t}-img is-placeholder`}),(0,r.createElement)("div",{className:`${t}-text`},(0,r.createElement)("h3",{className:"is-placeholder","aria-hidden":"true"}),(0,r.createElement)("p",{className:`${t}-meta is-placeholder`})))};const S=e=>{let{posts:t,isLoading:n,error:o,title:a,description:s,category:c}=e;const[l,m]=(0,r.useState)(1),[d,g]=(0,r.useState)(null),_=c?`woocommerce-marketing-knowledgebase-card__category-${c}`:"";return(0,r.createElement)(h.Zb,{title:a,description:s,className:f()("woocommerce-marketing-knowledgebase-card",_)},n?(0,r.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__posts"},(0,r.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__page"},(0,r.createElement)(R,null),(0,r.createElement)(R,null))):o?(()=>{const e=(0,i.__)("Oops, our posts aren't loading right now","woocommerce");return(0,r.createElement)(u.EmptyContent,{title:e,message:(0,r.createElement)(h.WL,null),illustration:"",actionLabel:""})})():0===t.length?(()=>{const e=(0,i.__)("No posts yet","woocommerce");return(0,r.createElement)(u.EmptyContent,{title:e,message:(0,r.createElement)(h.WL,null),illustration:"",actionLabel:""})})():(0,r.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__posts"},(0,r.createElement)(h.iR,{animationKey:l,animate:d},(()=>{const e=t.slice(2*(l-1),2*(l-1)+2),n=f()("woocommerce-marketing-knowledgebase-card__page",{"page-with-single-post":1===e.length}),o=e.map(((e,t)=>(0,r.createElement)("a",{className:"woocommerce-marketing-knowledgebase-card__post",href:e.link,key:t,onClick:()=>{(e=>{(0,p.recordEvent)("marketing_knowledge_article",{title:e.title})})(e)},target:"_blank",rel:"noopener noreferrer"},e.image&&(0,r.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__post-img"},(0,r.createElement)("img",{src:e.image,alt:""})),(0,r.createElement)("div",{className:"woocommerce-marketing-knowledgebase-card__post-text"},(0,r.createElement)("h3",null,e.title),(0,r.createElement)("p",{className:"woocommerce-marketing-knowledgebase-card__post-meta"},(0,i.__)("By","woocommerce")+" ",e.author_name,e.author_avatar&&(0,r.createElement)("img",{src:e.author_avatar.replace("s=96","s=32"),className:"woocommerce-gravatar",alt:"",width:"16",height:"16"}))))));return(0,r.createElement)("div",{className:n},o)})()),(0,r.createElement)(u.Pagination,{page:l,perPage:2,total:t.length,onPageChange:e=>{let t;e>l?(t="left",(0,p.recordEvent)("marketing_knowledge_carousel",{direction:"forward",page:e})):(t="right",(0,p.recordEvent)("marketing_knowledge_carousel",{direction:"back",page:e})),m(e),g(t)},showPagePicker:!1,showPerPagePicker:!1,showPageArrowsLabel:!1})))};S.propTypes={posts:m().arrayOf(m().object).isRequired,isLoading:m().bool.isRequired,title:m().string,description:m().string,category:m().string},S.defaultProps={title:(0,i.__)("WooCommerce knowledge base","woocommerce"),description:(0,i.__)("Learn the ins and outs of successful marketing from the experts at WooCommerce.","woocommerce")};var q=(0,s.compose)((0,c.withSelect)(((e,t)=>{const{getBlogPosts:n,getBlogPostsError:r,isResolving:o}=e(w.L);return{posts:n(t.category),isLoading:o("getBlogPosts",[t.category]),error:r(t.category)}})),(0,c.withDispatch)((e=>{const{createNotice:t}=e("core/notices");return{createNotice:t}})))(S),A=n(46634),B=n(37915);const T=e=>{let{isHidden:t,updateOptions:n}=e;return t?null:(0,r.createElement)(d.Card,{className:"woocommerce-marketing-overview-welcome-card"},(0,r.createElement)(d.CardBody,null,(0,r.createElement)(d.Button,{label:(0,i.__)("Hide","woocommerce"),onClick:()=>{n({woocommerce_marketing_overview_welcome_hidden:"yes"}),(0,p.recordEvent)("marketing_intro_close",{})},className:"woocommerce-marketing-overview-welcome-card__hide-button"},(0,r.createElement)(A.Z,null)),(0,r.createElement)("img",{src:B,alt:""}),(0,r.createElement)("h3",null,(0,i.__)("Grow your customer base and increase your sales with marketing tools built for WooCommerce","woocommerce"))))};T.propTypes={isHidden:m().bool.isRequired,updateOptions:m().func.isRequired};var U=(0,s.compose)((0,c.withSelect)((e=>{const{getOption:t,isOptionsUpdating:n}=e(o.OPTIONS_STORE_NAME),r=n();return{isHidden:"yes"===t("woocommerce_marketing_overview_welcome_hidden")||r}})),(0,c.withDispatch)((e=>{const{updateOptions:t}=e(o.OPTIONS_STORE_NAME);return{updateOptions:t}})))(T),j=n(79205),$=n(15635);const F="experimental_woocommerce_marketing_overview_section",I=e=>{let{children:t,order:n=1}=e;return(0,r.createElement)(d.Fill,{name:F},(e=>(0,$.uh)(t,n,e)))};I.Slot=e=>{let{fillProps:t}=e;return(0,r.createElement)(d.Slot,{name:F,fillProps:t},$.qk)};const H=e=>{var t;let{className:n}=e;const o=(0,g.useSlot)(F);return Boolean(null==o||null===(t=o.fills)||void 0===t?void 0:t.length)?(0,r.createElement)("div",{className:f()("woocommerce-marketing-overview__section",n)},(0,r.createElement)(I.Slot,null)):null};n(77975);var z=(0,o.withOptionsHydration)({...(0,j.O3)("preloadOptions",{})})((()=>{const{currentUserCan:e}=(0,o.useUser)(),t=(0,j.O3)("allowMarketplaceSuggestions",!1)&&e("install_plugins");return(0,r.createElement)("div",{className:"woocommerce-marketing-overview"},(0,r.createElement)(U,null),(0,r.createElement)(E,null),(0,r.createElement)(H,null),t&&(0,r.createElement)(L,{category:"marketing"}),(0,r.createElement)(q,{category:"marketing"}))}))},46634:function(e,t,n){t.Z=function(e){var t=e.size,n=void 0===t?24:t,r=e.onClick,s=(e.icon,e.className),c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r