芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/woocommerce/assets/client/admin/chunks/dashboard-charts.js
"use strict";(self.webpackChunk_wcAdmin_webpackJsonp=self.webpackChunk_wcAdmin_webpackJsonp||[]).push([[2397],{5945:function(e,o,r){var t=r(69307),c=r(65736),a=r(7862),l=r.n(a),s=r(86020);function n(e){let{className:o}=e;const r=(0,c.__)("There was an error getting your stats. Please try again.","woocommerce"),a=(0,c.__)("Reload","woocommerce");return(0,t.createElement)(s.EmptyContent,{className:o,title:r,actionLabel:a,actionCallback:()=>{window.location.reload()}})}n.propTypes={className:l().string},o.Z=n},38614:function(e,o,r){r.d(o,{O3:function(){return m},be:function(){return i},u8:function(){return u}});var t=r(65736),c=r(92694),a=r(9818),l=r(68734),s=r(30226);const{addCesSurveyForAnalytics:n}=(0,a.dispatch)(s.Ls),m=(0,c.applyFilters)("woocommerce_admin_coupons_report_charts",[{key:"orders_count",label:(0,t.__)("Discounted orders","woocommerce"),order:"desc",orderby:"orders_count",type:"number"},{key:"amount",label:(0,t.__)("Amount","woocommerce"),order:"desc",orderby:"amount",type:"currency"}]),i=(0,c.applyFilters)("woocommerce_admin_coupon_report_advanced_filters",{filters:{},title:(0,t._x)("Coupons match {{select /}} filters","A sentence describing filters for Coupons. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ","woocommerce")}),d=[{label:(0,t.__)("All coupons","woocommerce"),value:"all"},{label:(0,t.__)("Single coupon","woocommerce"),value:"select_coupon",chartMode:"item-comparison",subFilters:[{component:"Search",value:"single_coupon",chartMode:"item-comparison",path:["select_coupon"],settings:{type:"coupons",param:"coupons",getLabels:l.hQ,labels:{placeholder:(0,t.__)("Type to search for a coupon","woocommerce"),button:(0,t.__)("Single Coupon","woocommerce")}}}]},{label:(0,t.__)("Comparison","woocommerce"),value:"compare-coupons",settings:{type:"coupons",param:"coupons",getLabels:l.hQ,labels:{title:(0,t.__)("Compare Coupon Codes","woocommerce"),update:(0,t.__)("Compare","woocommerce"),helpText:(0,t.__)("Check at least two coupon codes below to compare","woocommerce")},onClick:n}}];Object.keys(i.filters).length&&d.push({label:(0,t.__)("Advanced filters","woocommerce"),value:"advanced"});const u=(0,c.applyFilters)("woocommerce_admin_coupons_report_filters",[{label:(0,t.__)("Show","woocommerce"),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:d}])},2765:function(e,o,r){r.d(o,{O3:function(){return l},be:function(){return n},u8:function(){return s}});var t=r(65736),c=r(92694),a=r(68734);const l=(0,c.applyFilters)("woocommerce_admin_downloads_report_charts",[{key:"download_count",label:(0,t.__)("Downloads","woocommerce"),type:"number"}]),s=(0,c.applyFilters)("woocommerce_admin_downloads_report_filters",[{label:(0,t.__)("Show","woocommerce"),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:[{label:(0,t.__)("All downloads","woocommerce"),value:"all"},{label:(0,t.__)("Advanced filters","woocommerce"),value:"advanced"}]}]),n=(0,c.applyFilters)("woocommerce_admin_downloads_report_advanced_filters",{title:(0,t._x)("Downloads match {{select /}} filters","A sentence describing filters for Downloads. See screen shot for context: https://cloudup.com/ccxhyH2mEDg","woocommerce"),filters:{product:{labels:{add:(0,t.__)("Product","woocommerce"),placeholder:(0,t.__)("Search","woocommerce"),remove:(0,t.__)("Remove product filter","woocommerce"),rule:(0,t.__)("Select a product filter match","woocommerce"),title:(0,t.__)("{{title}}Product{{/title}} {{rule /}} {{filter /}}","woocommerce"),filter:(0,t.__)("Select product","woocommerce")},rules:[{value:"includes",label:(0,t._x)("Includes","products","woocommerce")},{value:"excludes",label:(0,t._x)("Excludes","products","woocommerce")}],input:{component:"Search",type:"products",getLabels:a.oC}},customer:{labels:{add:(0,t.__)("Username","woocommerce"),placeholder:(0,t.__)("Search customer username","woocommerce"),remove:(0,t.__)("Remove customer username filter","woocommerce"),rule:(0,t.__)("Select a customer username filter match","woocommerce"),title:(0,t.__)("{{title}}Username{{/title}} {{rule /}} {{filter /}}","woocommerce"),filter:(0,t.__)("Select customer username","woocommerce")},rules:[{value:"includes",label:(0,t._x)("Includes","customer usernames","woocommerce")},{value:"excludes",label:(0,t._x)("Excludes","customer usernames","woocommerce")}],input:{component:"Search",type:"usernames",getLabels:a.jk}},order:{labels:{add:(0,t.__)("Order #","woocommerce"),placeholder:(0,t.__)("Search order number","woocommerce"),remove:(0,t.__)("Remove order number filter","woocommerce"),rule:(0,t.__)("Select a order number filter match","woocommerce"),title:(0,t.__)("{{title}}Order #{{/title}} {{rule /}} {{filter /}}","woocommerce"),filter:(0,t.__)("Select order number","woocommerce")},rules:[{value:"includes",label:(0,t._x)("Includes","order numbers","woocommerce")},{value:"excludes",label:(0,t._x)("Excludes","order numbers","woocommerce")}],input:{component:"Search",type:"orders",getLabels:async e=>{const o=e.split(",");return await o.map((e=>({id:e,label:"#"+e})))}}},ip_address:{labels:{add:(0,t.__)("IP Address","woocommerce"),placeholder:(0,t.__)("Search IP address","woocommerce"),remove:(0,t.__)("Remove IP address filter","woocommerce"),rule:(0,t.__)("Select an IP address filter match","woocommerce"),title:(0,t.__)("{{title}}IP Address{{/title}} {{rule /}} {{filter /}}","woocommerce"),filter:(0,t.__)("Select IP address","woocommerce")},rules:[{value:"includes",label:(0,t._x)("Includes","IP addresses","woocommerce")},{value:"excludes",label:(0,t._x)("Excludes","IP addresses","woocommerce")}],input:{component:"Search",type:"downloadIps",getLabels:async e=>{const o=e.split(",");return await o.map((e=>({id:e,label:e})))}}}}})},15391:function(e,o,r){r.d(o,{O3:function(){return m},be:function(){return u},u8:function(){return _}});var t=r(65736),c=r(92694),a=r(9818),l=r(68734),s=r(30226);const{addCesSurveyForAnalytics:n}=(0,a.dispatch)(s.Ls),m=(0,c.applyFilters)("woocommerce_admin_products_report_charts",[{key:"items_sold",label:(0,t.__)("Items sold","woocommerce"),order:"desc",orderby:"items_sold",type:"number"},{key:"net_revenue",label:(0,t.__)("Net sales","woocommerce"),order:"desc",orderby:"net_revenue",type:"currency"},{key:"orders_count",label:(0,t.__)("Orders","woocommerce"),order:"desc",orderby:"orders_count",type:"number"}]),i={label:(0,t.__)("Show","woocommerce"),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:[{label:(0,t.__)("All products","woocommerce"),value:"all"},{label:(0,t.__)("Single product","woocommerce"),value:"select_product",chartMode:"item-comparison",subFilters:[{component:"Search",value:"single_product",chartMode:"item-comparison",path:["select_product"],settings:{type:"products",param:"products",getLabels:l.oC,labels:{placeholder:(0,t.__)("Type to search for a product","woocommerce"),button:(0,t.__)("Single product","woocommerce")}}}]},{label:(0,t.__)("Comparison","woocommerce"),value:"compare-products",chartMode:"item-comparison",settings:{type:"products",param:"products",getLabels:l.oC,labels:{helpText:(0,t.__)("Check at least two products below to compare","woocommerce"),placeholder:(0,t.__)("Search for products to compare","woocommerce"),title:(0,t.__)("Compare Products","woocommerce"),update:(0,t.__)("Compare","woocommerce")},onClick:n}}]},d={showFilters:e=>"single_product"===e.filter&&!!e.products&&e["is-variable"],staticParams:["filter","products","chartType","paged","per_page"],param:"filter-variations",filters:[{label:(0,t.__)("All variations","woocommerce"),chartMode:"item-comparison",value:"all"},{label:(0,t.__)("Single variation","woocommerce"),value:"select_variation",subFilters:[{component:"Search",value:"single_variation",path:["select_variation"],settings:{type:"variations",param:"variations",getLabels:l.uC,labels:{placeholder:(0,t.__)("Type to search for a variation","woocommerce"),button:(0,t.__)("Single variation","woocommerce")}}}]},{label:(0,t.__)("Comparison","woocommerce"),chartMode:"item-comparison",value:"compare-variations",settings:{type:"variations",param:"variations",getLabels:l.uC,labels:{helpText:(0,t.__)("Check at least two variations below to compare","woocommerce"),placeholder:(0,t.__)("Search for variations to compare","woocommerce"),title:(0,t.__)("Compare Variations","woocommerce"),update:(0,t.__)("Compare","woocommerce")}}}]},u=(0,c.applyFilters)("woocommerce_admin_products_report_advanced_filters",{filters:{},title:(0,t._x)("Products Match {{select /}} Filters","A sentence describing filters for Products. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ","woocommerce")});Object.keys(u.filters).length&&(i.filters.push({label:(0,t.__)("Advanced Filters","woocommerce"),value:"advanced"}),d.filters.push({label:(0,t.__)("Advanced Filters","woocommerce"),value:"advanced"}));const _=(0,c.applyFilters)("woocommerce_admin_products_report_filters",[i,d])},17556:function(e,o,r){r.d(o,{O3:function(){return a},be:function(){return l},u8:function(){return n}});var t=r(65736),c=r(92694);const a=(0,c.applyFilters)("woocommerce_admin_revenue_report_charts",[{key:"gross_sales",label:(0,t.__)("Gross sales","woocommerce"),order:"desc",orderby:"gross_sales",type:"currency",isReverseTrend:!1},{key:"refunds",label:(0,t.__)("Returns","woocommerce"),order:"desc",orderby:"refunds",type:"currency",isReverseTrend:!0},{key:"coupons",label:(0,t.__)("Coupons","woocommerce"),order:"desc",orderby:"coupons",type:"currency",isReverseTrend:!1},{key:"net_revenue",label:(0,t.__)("Net sales","woocommerce"),orderby:"net_revenue",type:"currency",isReverseTrend:!1,labelTooltipText:(0,t.__)("Full refunds are not deducted from tax or net sales totals","woocommerce")},{key:"taxes",label:(0,t.__)("Taxes","woocommerce"),order:"desc",orderby:"taxes",type:"currency",isReverseTrend:!1,labelTooltipText:(0,t.__)("Full refunds are not deducted from tax or net sales totals","woocommerce")},{key:"shipping",label:(0,t.__)("Shipping","woocommerce"),orderby:"shipping",type:"currency",isReverseTrend:!1},{key:"total_sales",label:(0,t.__)("Total sales","woocommerce"),order:"desc",orderby:"total_sales",type:"currency",isReverseTrend:!1}]),l=(0,c.applyFilters)("woocommerce_admin_revenue_report_advanced_filters",{filters:{},title:(0,t._x)("Revenue Matches {{select /}} Filters","A sentence describing filters for Revenue. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ","woocommerce")}),s=[];Object.keys(l.filters).length&&(s.push({label:(0,t.__)("All Revenue","woocommerce"),value:"all"}),s.push({label:(0,t.__)("Advanced Filters","woocommerce"),value:"advanced"}));const n=(0,c.applyFilters)("woocommerce_admin_revenue_report_filters",[{label:(0,t.__)("Show","woocommerce"),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>s.length>0,filters:s}])},63871:function(e,o,r){r.d(o,{O3:function(){return d},be:function(){return u},u8:function(){return p}});var t=r(65736),c=r(92694),a=r(67221),l=r(9818),s=r(68734),n=r(69629),m=r(30226);const{addCesSurveyForAnalytics:i}=(0,l.dispatch)(m.Ls),d=(0,c.applyFilters)("woocommerce_admin_taxes_report_charts",[{key:"total_tax",label:(0,t.__)("Total tax","woocommerce"),order:"desc",orderby:"total_tax",type:"currency"},{key:"order_tax",label:(0,t.__)("Order tax","woocommerce"),order:"desc",orderby:"order_tax",type:"currency"},{key:"shipping_tax",label:(0,t.__)("Shipping tax","woocommerce"),order:"desc",orderby:"shipping_tax",type:"currency"},{key:"orders_count",label:(0,t.__)("Orders","woocommerce"),order:"desc",orderby:"orders_count",type:"number"}]),u=(0,c.applyFilters)("woocommerce_admin_taxes_report_advanced_filters",{filters:{},title:(0,t._x)("Taxes match {{select /}} filters","A sentence describing filters for Taxes. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ","woocommerce")}),_=[{label:(0,t.__)("All taxes","woocommerce"),value:"all"},{label:(0,t.__)("Comparison","woocommerce"),value:"compare-taxes",chartMode:"item-comparison",settings:{type:"taxes",param:"taxes",getLabels:(0,s.qc)(a.NAMESPACE+"/taxes",(e=>({id:e.id,key:e.id,label:(0,n.I)(e)}))),labels:{helpText:(0,t.__)("Check at least two tax codes below to compare","woocommerce"),placeholder:(0,t.__)("Search for tax codes to compare","woocommerce"),title:(0,t.__)("Compare Tax Codes","woocommerce"),update:(0,t.__)("Compare","woocommerce")},onClick:i}}];Object.keys(u.filters).length&&_.push({label:(0,t.__)("Advanced filters","woocommerce"),value:"advanced"});const p=(0,c.applyFilters)("woocommerce_admin_taxes_report_filters",[{label:(0,t.__)("Show","woocommerce"),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:_}])},67317:function(e,o,r){r.r(o),r.d(o,{default:function(){return L}});var t=r(69307),c=r(65736),a=r(83849),l=r.n(a),s=r(73701),n=r(72197),m=r(7862),i=r.n(m),d=r(55609),u=r(86020),_=r(67221),p=r(81921),h=r(14599),w=r(17538),y=r(10431),b=r(74617),f=r(14812),v=r(43707);class g extends t.Component{constructor(){super(...arguments),(0,w.Z)(this,"handleChartClick",(()=>{const{selectedChart:e}=this.props;(0,y.getHistory)().push(this.getChartPath(e))}))}getChartPath(e){return(0,y.getNewPath)({chart:e.key},"/analytics/"+e.endpoint,(0,y.getPersistedQuery)())}render(){const{charts:e,endpoint:o,path:r,query:a,selectedChart:l,filters:s}=this.props;return l?(0,t.createElement)("div",{role:"presentation",className:"woocommerce-dashboard__chart-block-wrapper",onClick:this.handleChartClick},(0,t.createElement)(d.Card,{className:"woocommerce-dashboard__chart-block"},(0,t.createElement)(d.CardHeader,null,(0,t.createElement)(f.Text,{as:"h3",size:16,weight:600,color:"#23282d"},l.label)),(0,t.createElement)(d.CardBody,{size:null},(0,t.createElement)("a",{className:"screen-reader-text",href:(0,b.getAdminLink)(this.getChartPath(l))},(0,c.sprintf)((0,c.__)("%s Report","woocommerce"),l.label)),(0,t.createElement)(v.Z,{charts:e,endpoint:o,query:a,interactiveLegend:!1,legendPosition:"bottom",path:r,selectedChart:l,showHeaderControls:!1,filters:s})))):null}}g.propTypes={charts:i().array,endpoint:i().string.isRequired,path:i().string.isRequired,query:i().object.isRequired,selectedChart:i().object.isRequired};var k=g,x=r(92694),C=r(32217),S=r(15391),T=r(17556),O=r(38614),E=r(63871),F=r(2765);const P={revenue:T.O3,orders:C.O3,products:S.O3,coupons:O.O3,taxes:E.O3,downloads:F.O3},R=[{label:(0,c.__)("Total sales","woocommerce"),report:"revenue",key:"total_sales"},{label:(0,c.__)("Net sales","woocommerce"),report:"revenue",key:"net_revenue"},{label:(0,c.__)("Orders","woocommerce"),report:"orders",key:"orders_count"},{label:(0,c.__)("Average order value","woocommerce"),report:"orders",key:"avg_order_value"},{label:(0,c.__)("Items sold","woocommerce"),report:"products",key:"items_sold"},{label:(0,c.__)("Returns","woocommerce"),report:"revenue",key:"refunds"},{label:(0,c.__)("Discounted orders","woocommerce"),report:"coupons",key:"orders_count"},{label:(0,c.__)("Gross discounted","woocommerce"),report:"coupons",key:"amount"},{label:(0,c.__)("Total tax","woocommerce"),report:"taxes",key:"total_tax"},{label:(0,c.__)("Order tax","woocommerce"),report:"taxes",key:"order_tax"},{label:(0,c.__)("Shipping tax","woocommerce"),report:"taxes",key:"shipping_tax"},{label:(0,c.__)("Shipping","woocommerce"),report:"revenue",key:"shipping"},{label:(0,c.__)("Downloads","woocommerce"),report:"downloads",key:"download_count"}],A=(0,x.applyFilters)("woocommerce_admin_dashboard_charts_filter",R.map((e=>({...P[e.report].find((o=>o.key===e.key)),label:e.label,endpoint:e.report})))),I=e=>{const{controls:o,hiddenBlocks:r,isFirst:a,isLast:m,onMove:i,onRemove:w,onTitleBlur:y,onTitleChange:b,onToggleHiddenBlock:f,path:v,title:g,titleInput:x,filters:C,defaultDateRange:S}=e,{updateUserPreferences:T,...O}=(0,_.useUserPreferences)(),[E,F]=(0,t.useState)(O.dashboard_chart_type||"line"),[P,R]=(0,t.useState)(O.dashboard_chart_interval||"day"),I={...e.query,chartType:E,interval:P},L=e=>()=>{F(e),T({dashboard_chart_type:e}),(0,h.recordEvent)("dash_charts_type_toggle",{chart_type:e})};return(0,t.createElement)("div",{className:"woocommerce-dashboard__dashboard-charts"},(0,t.createElement)(u.SectionHeader,{title:g||(0,c.__)("Charts","woocommerce"),menu:(0,t.createElement)(u.EllipsisMenu,{label:(0,c.__)("Choose which charts to display","woocommerce"),renderContent:e=>{let{onToggle:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuTitle,null,(0,c.__)("Charts","woocommerce")),(e=>{let{hiddenBlocks:o,onToggleHiddenBlock:r}=e;return A.map((e=>{const c=e.endpoint+"_"+e.key,a=!o.includes(c);return(0,t.createElement)(u.MenuItem,{checked:a,isCheckbox:!0,isClickable:!0,key:e.endpoint+"_"+e.key,onInvoke:()=>{r(c)(),(0,h.recordEvent)("dash_charts_chart_toggle",{status:a?"off":"on",key:c})}},e.label)}))})({hiddenBlocks:r,onToggleHiddenBlock:f}),(0,t.createElement)(o,{onToggle:l,onMove:i,onRemove:w,isFirst:a,isLast:m,onTitleBlur:y,onTitleChange:b,titleInput:x}))}}),className:"has-interval-select"},(e=>{let{chartInterval:o,setInterval:r,query:a,defaultDateRange:l}=e;const s=(0,p.getAllowedIntervalsForQuery)(a,l);if(!s||s.length<1)return null;const n={hour:(0,c.__)("By hour","woocommerce"),day:(0,c.__)("By day","woocommerce"),week:(0,c.__)("By week","woocommerce"),month:(0,c.__)("By month","woocommerce"),quarter:(0,c.__)("By quarter","woocommerce"),year:(0,c.__)("By year","woocommerce")};return(0,t.createElement)(d.SelectControl,{className:"woocommerce-chart__interval-select",value:o,options:s.map((e=>({value:e,label:n[e]}))),"aria-label":"Chart period",onChange:r})})({chartInterval:P,setInterval:e=>{R(e),T({dashboard_chart_interval:e}),(0,h.recordEvent)("dash_charts_interval",{interval:e})},query:I,defaultDateRange:S}),(0,t.createElement)(d.NavigableMenu,{className:"woocommerce-chart__types",orientation:"horizontal",role:"menubar"},(0,t.createElement)(d.Button,{className:l()("woocommerce-chart__type-button",{"woocommerce-chart__type-button-selected":!I.chartType||"line"===I.chartType}),title:(0,c.__)("Line chart","woocommerce"),"aria-checked":"line"===I.chartType,role:"menuitemradio",tabIndex:"line"===I.chartType?0:-1,onClick:L("line")},(0,t.createElement)(s.Z,null)),(0,t.createElement)(d.Button,{className:l()("woocommerce-chart__type-button",{"woocommerce-chart__type-button-selected":"bar"===I.chartType}),title:(0,c.__)("Bar chart","woocommerce"),"aria-checked":"bar"===I.chartType,role:"menuitemradio",tabIndex:"bar"===I.chartType?0:-1,onClick:L("bar")},(0,t.createElement)(n.Z,null)))),(e=>{let{hiddenBlocks:o,path:r,query:c,filters:a}=e;const l=A.reduce(((e,o)=>(void 0===e[o.endpoint]&&(e[o.endpoint]=[]),e[o.endpoint].push(o),e)),{});return(0,t.createElement)("div",{className:"woocommerce-dashboard__columns"},A.map((e=>o.includes(e.endpoint+"_"+e.key)?null:(0,t.createElement)(k,{charts:l[e.endpoint],endpoint:e.endpoint,key:e.endpoint+"_"+e.key,path:r,query:c,selectedChart:e,filters:a}))))})({hiddenBlocks:r,path:v,query:I,filters:C}))};I.propTypes={path:i().string.isRequired,query:i().object.isRequired,defaultDateRange:i().string.isRequired};var L=I},73701:function(e,o,r){o.Z=function(e){var o=e.size,r=void 0===o?24:o,t=e.onClick,s=(e.icon,e.className),n=function(e,o){if(null==e)return{};var r,t,c=function(e,o){if(null==e)return{};var r,t,c={},a=Object.keys(e);for(t=0;t