1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
|
"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[5838],{65994:(e,t,r)=>{r.d(t,{Z:()=>l});var a=r(69307),o=r(65736),n=r(7862),s=r.n(n),i=r(86020);function c(e){let{className:t}=e;const r=(0,o.__)("There was an error getting your stats. Please try again.","woocommerce"),n=(0,o.__)("Reload","woocommerce");return(0,a.createElement)(i.EmptyContent,{className:t,title:r,actionLabel:n,actionCallback:()=>{window.location.reload()}})}c.propTypes={className:s().string};const l=c},98552:(e,t,r)=>{r.d(t,{Z:()=>_});var a=r(69307),o=r(94333),n=r(7862),s=r.n(n),i=r(92819),c=r(9818),l=r(75606),d=r(86020),m=r(67221),u=r(81921),p=r(14599),g=r(17844),y=r(73463);class h extends a.Component{constructor(){super(),this.onDateSelect=this.onDateSelect.bind(this),this.onFilterSelect=this.onFilterSelect.bind(this),this.onAdvancedFilterAction=this.onAdvancedFilterAction.bind(this)}onDateSelect(e){const{report:t,addCesSurveyForAnalytics:r}=this.props;r(),(0,p.recordEvent)("datepicker_update",{report:t,...(0,i.omitBy)(e,i.isUndefined)})}onFilterSelect(e){const{report:t,addCesSurveyForAnalytics:r}=this.props,a=e.filter||e["filter-variations"];["single_product","single_category","single_coupon","single_variation"].includes(a)&&r();const o={report:t,filter:e.filter||"all"};"single_product"===e.filter&&(o.filter_variation=e["filter-variations"]||"all"),(0,p.recordEvent)("analytics_filter",o)}onAdvancedFilterAction(e,t){const{report:r,addCesSurveyForAnalytics:a}=this.props;switch(e){case"add":(0,p.recordEvent)("analytics_filters_add",{report:r,filter:t.key});break;case"remove":(0,p.recordEvent)("analytics_filters_remove",{report:r,filter:t.key});break;case"filter":const e=Object.keys(t).reduce(((e,r)=>(e[(0,i.snakeCase)(r)]=t[r],e)),{});a(),(0,p.recordEvent)("analytics_filters_filter",{report:r,...e});break;case"clear_all":(0,p.recordEvent)("analytics_filters_clear_all",{report:r});break;case"match":(0,p.recordEvent)("analytics_filters_all_any",{report:r,value:t.match})}}render(){const{advancedFilters:e,filters:t,path:r,query:o,showDatePicker:n,defaultDateRange:s}=this.props,{period:i,compare:c,before:l,after:m}=(0,u.getDateParamsFromQuery)(o,s),{primary:p,secondary:g}=(0,u.getCurrentDates)(o,s),h={period:i,compare:c,before:l,after:m,primaryDate:p,secondaryDate:g},_=this.context;return(0,a.createElement)(d.ReportFilters,{query:o,siteLocale:y.MV.siteLocale,currency:_.getCurrencyConfig(),path:r,filters:t,advancedFilters:e,showDatePicker:n,onDateSelect:this.onDateSelect,onFilterSelect:this.onFilterSelect,onAdvancedFilterAction:this.onAdvancedFilterAction,dateQuery:h,isoDateFormat:u.isoDateFormat})}}h.contextType=g.CurrencyContext;const _=(0,o.compose)((0,c.withSelect)((e=>{const{woocommerce_default_date_range:t}=e(m.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{defaultDateRange:t}})),(0,c.withDispatch)((e=>{const{addCesSurveyForAnalytics:t}=e(l.STORE_KEY);return{addCesSurveyForAnalytics:t}})))(h);h.propTypes={advancedFilters:s().object,filters:s().array,path:s().string.isRequired,query:s().object,showDatePicker:s().bool,report:s().string.isRequired}},95931:(e,t,r)=>{r.d(t,{Z:()=>F});var a=r(5267),o=r(69307),n=r(55609),s=r(92694),i=r(94333),c=r(45904),l=r(9818),d=r(92819),m=r(65736),u=r(7862),p=r.n(u),g=r(75606),y=r(86020),h=r(10431),_=r(49742),b=r(67221),f=r(14599);const w=()=>(0,o.createElement)("svg",{role:"img","aria-hidden":"true",focusable:"false",version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24"},(0,o.createElement)("path",{d:"M18,9c-0.009,0-0.017,0.002-0.025,0.003C17.72,5.646,14.922,3,11.5,3C7.91,3,5,5.91,5,9.5c0,0.524,0.069,1.031,0.186,1.519 C5.123,11.016,5.064,11,5,11c-2.209,0-4,1.791-4,4c0,1.202,0.541,2.267,1.38,3h18.593C22.196,17.089,23,15.643,23,14 C23,11.239,20.761,9,18,9z M12,16l-4-5h3V8h2v3h3L12,16z"}));var S=r(65994);const C=e=>{const{getHeadersContent:t,getRowsContent:r,getSummary:i,isRequesting:l,primaryData:u,tableData:p,endpoint:g,itemIdField:C,tableQuery:v,compareBy:E,compareParam:F,searchBy:R,labels:k={},...D}=e,{
|