관리-도구
편집 파일: analytics-report-variations.js
(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[23],{746:function(e,t,r){"use strict";r.r(t);var a=r(5),n=r.n(a),o=r(0),i=r(3),c=r(1),s=r.n(c),l=r(55),u=r(764),m=Object(l.applyFilters)("kkart_admin_variations_report_charts",[{key:"items_sold",label:Object(i.__)("Items Sold",'kkart'),order:"desc",orderby:"items_sold",type:"number"},{key:"net_revenue",label:Object(i.__)("Net Sales",'kkart'),order:"desc",orderby:"net_revenue",type:"currency"},{key:"orders_count",label:Object(i.__)("Orders",'kkart'),order:"desc",orderby:"orders_count",type:"number"}]),d=Object(l.applyFilters)("kkart_admin_variations_report_filters",[{label:Object(i.__)("Show",'kkart'),staticParams:["chartType","paged","per_page"],param:"filter-variations",showFilters:function(){return!0},filters:[{label:Object(i.__)("All Variations",'kkart'),chartMode:"item-comparison",value:"all"},{label:Object(i.__)("Single Variation",'kkart'),value:"select_variation",subFilters:[{component:"Search",value:"single_variation",path:["select_variation"],settings:{type:"variations",param:"variations",getLabels:u.g,labels:{placeholder:Object(i.__)("Type to search for a variation",'kkart'),button:Object(i.__)("Single Variation",'kkart')}}}]},{label:Object(i.__)("Comparison",'kkart'),chartMode:"item-comparison",value:"compare-variations",settings:{type:"variations",param:"variations",getLabels:u.g,labels:{helpText:Object(i.__)("Check at least two variations below to compare",'kkart'),placeholder:Object(i.__)("Search for variations to compare",'kkart'),title:Object(i.__)("Compare Variations",'kkart'),update:Object(i.__)("Compare",'kkart')}}},{label:Object(i.__)("Advanced Filters",'kkart'),value:"advanced"}]}]),p=Object(l.applyFilters)("kkart_admin_variations_report_advanced_filters",{title:Object(i._x)("Variations Match {{select /}} Filters","A sentence describing filters for Variations. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ",'kkart'),filters:{attribute:{allowMultiple:!0,labels:{add:Object(i.__)("Attribute",'kkart'),placeholder:Object(i.__)("Search attributes",'kkart'),remove:Object(i.__)("Remove attribute filter",'kkart'),rule:Object(i.__)("Select a product attribute filter match",'kkart'),title:Object(i.__)("{{title}}Attribute{{/title}} {{rule /}} {{filter /}}",'kkart'),filter:Object(i.__)("Select attributes",'kkart')},rules:[{value:"is",label:Object(i._x)("Is","product attribute",'kkart')},{value:"is_not",label:Object(i._x)("Is Not","product attribute",'kkart')}],input:{component:"ProductAttribute"}},category:{labels:{add:Object(i.__)("Categories",'kkart'),placeholder:Object(i.__)("Search categories",'kkart'),remove:Object(i.__)("Remove categories filter",'kkart'),rule:Object(i.__)("Select a category filter match",'kkart'),title:Object(i.__)("{{title}}Category{{/title}} {{rule /}} {{filter /}}",'kkart'),filter:Object(i.__)("Select categories",'kkart')},rules:[{value:"includes",label:Object(i._x)("Includes","categories",'kkart')},{value:"excludes",label:Object(i._x)("Excludes","categories",'kkart')}],input:{component:"Search",type:"categories",getLabels:u.a}},product:{labels:{add:Object(i.__)("Products",'kkart'),placeholder:Object(i.__)("Search products",'kkart'),remove:Object(i.__)("Remove products filter",'kkart'),rule:Object(i.__)("Select a product filter match",'kkart'),title:Object(i.__)("{{title}}Product{{/title}} {{rule /}} {{filter /}}",'kkart'),filter:Object(i.__)("Select products",'kkart')},rules:[{value:"includes",label:Object(i._x)("Includes","products",'kkart')},{value:"excludes",label:Object(i._x)("Excludes","products",'kkart')}],input:{component:"Search",type:"variableProducts",getLabels:u.d}}}}),b=r(768),f=r(766),y=r(763),v=r(769),_=r(788),g=r(770);function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}var O=function(e){var t=function(e){var t=e.query,r="compare-variations"===t["filter-variations"]&&t.variations&&t.variations.split(",").length>1;return{compareObject:"variations",itemsLabel:Object(i.__)("%d variations",'kkart'),mode:r?"item-comparison":"time-comparison"}}(e),r=t.itemsLabel,a=t.mode,c=e.path,s=e.query,l=e.isError,u=e.isRequesting;if(l)return Object(o.createElement)(y.a,{isError:!0});var O=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){n()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},s);return"item-comparison"===a&&(O.segmentby="variation"),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(g.a,{query:s,path:c,filters:d,advancedFilters:p,report:"variations"}),Object(o.createElement)(v.a,{mode:a,charts:m,endpoint:"variations",isRequesting:u,query:O,selectedChart:Object(b.a)(s.chart,m),filters:d,advancedFilters:p}),Object(o.createElement)(f.a,{charts:m,mode:a,filters:d,advancedFilters:p,endpoint:"variations",isRequesting:u,itemsLabel:r,path:c,query:O,selectedChart:Object(b.a)(O.chart,m)}),Object(o.createElement)(_.a,{isRequesting:u,query:s,filters:d,advancedFilters:p}))};O.propTypes={path:s.a.string.isRequired,query:s.a.object.isRequired};t.default=O},764:function(e,t,r){"use strict";r.d(t,"e",(function(){return m})),r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return b})),r.d(t,"d",(function(){return f})),r.d(t,"f",(function(){return y})),r.d(t,"h",(function(){return v})),r.d(t,"g",(function(){return _}));var a=r(37),n=r(43),o=r.n(n),i=r(2),c=r(32),s=r(35),l=r(36),u=r(765);function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.identity;return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,i="function"==typeof e?e(n):e,s=Object(c.getIdsFromQuery)(r);if(s.length<1)return Promise.resolve([]);var l={include:s.join(","),per_page:s.length};return o()({path:Object(a.addQueryArgs)(i,l)}).then((function(e){return e.map(t)}))}}var d=m(s.NAMESPACE+"/products/categories",(function(e){return{key:e.id,label:e.name}})),p=m(s.NAMESPACE+"/coupons",(function(e){return{key:e.id,label:e.code}})),b=m(s.NAMESPACE+"/customers",(function(e){return{key:e.id,label:e.name}})),f=m(s.NAMESPACE+"/products",(function(e){return{key:e.id,label:e.name}})),y=m(s.NAMESPACE+"/taxes",(function(e){return{key:e.id,label:Object(u.a)(e)}}));function v(e){var t=e.attributes,r=e.name,a=Object(l.g)("variationTitleAttributesSeparator"," - ");if(r.indexOf(a)>-1)return r;var n=t.map((function(e){return e.option})).join(", ");return n?r+a+n:r}var _=m((function(e){var t=e.products;return t?s.NAMESPACE+"/products/".concat(t,"/variations"):s.NAMESPACE+"/variations"}),(function(e){return{key:e.id,label:v(e)}}))},765:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var a=r(3);function n(e){return[e.country,e.state,e.name||Object(a.__)("TAX",'kkart'),e.priority].map((function(e){return e.toString().toUpperCase().trim()})).filter(Boolean).join("-")}},766:function(e,t,r){"use strict";var a=r(5),n=r.n(a),o=r(17),i=r.n(o),c=r(15),s=r.n(c),l=r(18),u=r.n(l),m=r(19),d=r.n(m),p=r(9),b=r.n(p),f=r(0),y=r(3),v=r(277),_=r(154),g=r(20),h=r(2),O=r(1),j=r.n(O),w=r(77),R=r(35),S=r(40),k=r(762),C=r(763),q=r(32);function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach((function(t){n()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,a=b()(e);if(t){var n=b()(this).constructor;r=Reflect.construct(a,arguments,n)}else r=a.apply(this,arguments);return d()(this,r)}}var F=function(e){u()(r,e);var t=P(r);function r(){return i()(this,r),t.apply(this,arguments)}return s()(r,[{key:"shouldComponentUpdate",value:function(e){return e.isRequesting!==this.props.isRequesting||e.primaryData.isRequesting!==this.props.primaryData.isRequesting||e.secondaryData.isRequesting!==this.props.secondaryData.isRequesting||!Object(h.isEqual)(e.query,this.props.query)}},{key:"getItemChartData",value:function(){var e=this.props,t=e.primaryData,r=e.selectedChart;return t.data.intervals.map((function(e){var t={};return e.subtotals.segments.forEach((function(e){if(e.segment_label){var a=t[e.segment_label]?e.segment_label+" (#"+e.segment_id+")":e.segment_label;t[e.segment_id]={label:a,value:e.subtotals[r.key]||0}}})),E({date:Object(_.a)("Y-m-d\\TH:i:s",e.date_start)},t)}))}},{key:"getTimeChartData",value:function(){var e=this.props,t=e.query,r=e.primaryData,a=e.secondaryData,n=e.selectedChart,o=e.defaultDateRange,i=Object(S.getIntervalForQuery)(t),c=Object(S.getCurrentDates)(t,o),s=c.primary,l=c.secondary;return r.data.intervals.map((function(e,r){var o=Object(S.getPreviousDate)(e.date_start,s.after,l.after,t.compare,i),c=a.data.intervals[r];return{date:Object(_.a)("Y-m-d\\TH:i:s",e.date_start),primary:{label:"".concat(s.label," (").concat(s.range,")"),labelDate:e.date_start,value:e.subtotals[n.key]||0},secondary:{label:"".concat(l.label," (").concat(l.range,")"),labelDate:o.format("YYYY-MM-DD HH:mm:ss"),value:c&&c.subtotals[n.key]||0}}}))}},{key:"getTimeChartTotals",value:function(){var e=this.props,t=e.primaryData,r=e.secondaryData,a=e.selectedChart;return{primary:Object(h.get)(t,["data","totals",a.key],null),secondary:Object(h.get)(r,["data","totals",a.key],null)}}},{key:"renderChart",value:function(e,t,r,a){var n=this.props,o=n.emptySearchResults,i=n.filterParam,c=n.interactiveLegend,s=n.itemsLabel,l=n.legendPosition,u=n.path,m=n.query,d=n.selectedChart,p=n.showHeaderControls,b=n.primaryData,v=Object(S.getIntervalForQuery)(m),_=Object(S.getAllowedIntervalsForQuery)(m),g=Object(S.getDateFormatsForInterval)(v,b.data.intervals.length),h=o?Object(y.__)("No data for the current search",'kkart'):Object(y.__)("No data for the selected date range",'kkart'),O=this.context,j=O.formatAmount,k=O.getCurrencyConfig;return Object(f.createElement)(w.Chart,{allowedIntervals:_,data:r,dateParser:"%Y-%m-%dT%H:%M:%S",emptyMessage:h,filterParam:i,interactiveLegend:c,interval:v,isRequesting:t,itemsLabel:s,legendPosition:l,legendTotals:a,mode:e,path:u,query:m,screenReaderFormat:g.screenReaderFormat,showHeaderControls:p,title:d.label,tooltipLabelFormat:g.tooltipLabelFormat,tooltipTitle:"time-comparison"===e&&d.label||null,tooltipValueFormat:Object(R.getTooltipValueFormat)(d.type,j),chartType:Object(S.getChartTypeForQuery)(m),valueType:d.type,xFormat:g.xFormat,x2Format:g.x2Format,currency:k()})}},{key:"renderItemComparison",value:function(){var e=this.props,t=e.isRequesting,r=e.primaryData;if(r.isError)return Object(f.createElement)(C.a,{isError:!0});var a=t||r.isRequesting,n=this.getItemChartData();return this.renderChart("item-comparison",a,n)}},{key:"renderTimeComparison",value:function(){var e=this.props,t=e.isRequesting,r=e.primaryData,a=e.secondaryData;if(!r||r.isError||a.isError)return Object(f.createElement)(C.a,{isError:!0});var n=t||r.isRequesting||a.isRequesting,o=this.getTimeChartData(),i=this.getTimeChartTotals();return this.renderChart("time-comparison",n,o,i)}},{key:"render",value:function(){return"item-comparison"===this.props.mode?this.renderItemComparison():this.renderTimeComparison()}}]),r}(f.Component);F.contextType=k.a,F.propTypes={filters:j.a.array,isRequesting:j.a.bool,itemsLabel:j.a.string,limitProperties:j.a.array,mode:j.a.string,path:j.a.string.isRequired,primaryData:j.a.object,query:j.a.object.isRequired,secondaryData:j.a.object,selectedChart:j.a.shape({key:j.a.string.isRequired,label:j.a.string.isRequired,order:j.a.oneOf(["asc","desc"]),orderby:j.a.string,type:j.a.oneOf(["average","number","currency"]).isRequired}).isRequired},F.defaultProps={isRequesting:!1,primaryData:{data:{intervals:[]},isError:!1,isRequesting:!1},secondaryData:{data:{intervals:[]},isError:!1,isRequesting:!1}};t.a=Object(v.a)(Object(g.withSelect)((function(e,t){var r=t.charts,a=t.endpoint,n=t.filters,o=t.isRequesting,i=t.limitProperties,c=t.query,s=t.advancedFilters,l=i||[a],u=function e(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||0===t.length)return null;var n=t.slice(0),o=n.pop();if(o.showFilters(r,a)){var i=Object(q.flattenFilters)(o.filters),c=r[o.param]||o.defaultValue||"all";return Object(h.find)(i,{value:c})}return e(n,r,a)}(n,c),m=Object(h.get)(u,["settings","param"]),d=t.mode||function(e,t){if(e&&t){var r=Object(h.get)(e,["settings","param"]);if(!r||Object.keys(t).includes(r))return Object(h.get)(e,["chartMode"])}return null}(u,c)||"time-comparison",p=e(R.SETTINGS_STORE_NAME).getSetting("kkart_admin","wcAdminSettings").kkart_default_date_range,b={mode:d,filterParam:m,defaultDateRange:p};if(o)return b;var f=l.some((function(e){return c[e]&&c[e].length}));if(c.search&&!f)return E(E({},b),{},{emptySearchResults:!0});var y=r&&r.map((function(e){return e.key})),v=Object(R.getReportChartData)({endpoint:a,dataType:"primary",query:c,select:e,limitBy:l,filters:n,advancedFilters:s,defaultDateRange:p,fields:y});if("item-comparison"===d)return E(E({},b),{},{primaryData:v});var _=Object(R.getReportChartData)({endpoint:a,dataType:"secondary",query:c,select:e,limitBy:l,filters:n,advancedFilters:s,defaultDateRange:p,fields:y});return E(E({},b),{},{primaryData:v,secondaryData:_})})))(F)},768:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var a=r(2);function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object(a.find)(t,{key:e});return r||t[0]}},769:function(e,t,r){"use strict";var a=r(17),n=r.n(a),o=r(15),i=r.n(o),c=r(18),s=r.n(c),l=r(19),u=r.n(l),m=r(9),d=r.n(m),p=r(0),b=r(3),f=r(277),y=r(20),v=r(1),_=r.n(v),g=r(32),h=r(77),O=r(298),j=r(35),w=r(40),R=r(64),S=r(763),k=r(762);function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,a=d()(e);if(t){var n=d()(this).constructor;r=Reflect.construct(a,arguments,n)}else r=a.apply(this,arguments);return u()(this,r)}}var q=function(e){s()(r,e);var t=C(r);function r(){return n()(this,r),t.apply(this,arguments)}return i()(r,[{key:"formatVal",value:function(e,t){var r=this.context,a=r.formatAmount,n=r.getCurrencyConfig;return"currency"===t?a(e):Object(O.formatValue)(n(),t,e)}},{key:"getValues",value:function(e,t){var r=this.props,a=r.emptySearchResults,n=r.summaryData.totals,o=n.primary?n.primary[e]:0,i=n.secondary?n.secondary[e]:0,c=a?0:o,s=a?0:i;return{delta:Object(O.calculateDelta)(c,s),prevValue:this.formatVal(s,t),value:this.formatVal(c,t)}}},{key:"render",value:function(){var e=this,t=this.props,r=t.charts,a=t.query,n=t.selectedChart,o=t.summaryData,i=t.endpoint,c=t.report,s=t.defaultDateRange,l=o.isError,u=o.isRequesting;if(l)return Object(p.createElement)(S.a,{isError:!0});if(u)return Object(p.createElement)(h.SummaryListPlaceholder,{numberOfItems:r.length});var m=Object(w.getDateParamsFromQuery)(a,s).compare;return Object(p.createElement)(h.SummaryList,null,(function(t){var a=t.onToggle;return r.map((function(t){var r=t.key,o=t.order,s=t.orderby,l=t.label,u=t.type,d={chart:r};s&&(d.orderby=s),o&&(d.order=o);var f=Object(g.getNewPath)(d),y=n.key===r,v=e.getValues(r,u),_=v.delta,O=v.prevValue,j=v.value;return Object(p.createElement)(h.SummaryNumber,{key:r,delta:_,href:f,label:l,prevLabel:"previous_period"===m?Object(b.__)("Previous Period:",'kkart'):Object(b.__)("Previous Year:",'kkart'),prevValue:O,selected:y,value:j,onLinkClickCallback:function(){a&&a(),Object(R.recordEvent)("analytics_chart_tab_click",{report:c||i,key:r})}})}))}))}}]),r}(p.Component);q.propTypes={charts:_.a.array.isRequired,endpoint:_.a.string.isRequired,limitProperties:_.a.array,query:_.a.object.isRequired,selectedChart:_.a.shape({key:_.a.string.isRequired,label:_.a.string.isRequired,order:_.a.oneOf(["asc","desc"]),orderby:_.a.string,type:_.a.oneOf(["average","number","currency"]).isRequired}).isRequired,summaryData:_.a.object,report:_.a.string},q.defaultProps={summaryData:{totals:{primary:{},secondary:{}},isError:!1}},q.contextType=k.a,t.a=Object(f.a)(Object(y.withSelect)((function(e,t){var r=t.charts,a=t.endpoint,n=t.limitProperties,o=t.query,i=t.filters,c=t.advancedFilters,s=n||[a],l=s.some((function(e){return o[e]&&o[e].length}));if(o.search&&!l)return{emptySearchResults:!0};var u=r&&r.map((function(e){return e.key})),m=e(j.SETTINGS_STORE_NAME).getSetting("kkart_admin","wcAdminSettings").kkart_default_date_range;return{summaryData:Object(j.getSummaryNumbers)({endpoint:a,query:o,select:e,limitBy:s,filters:i,advancedFilters:c,defaultDateRange:m,fields:u}),defaultDateRange:m}})))(q)},781:function(e,t,r){"use strict";function a(e,t,r){return!!t&&(e&&t<=r==="instock")}r.d(t,"a",(function(){return a}))},788:function(e,t,r){"use strict";var a=r(17),n=r.n(a),o=r(15),i=r.n(o),c=r(11),s=r.n(c),l=r(18),u=r.n(l),m=r(19),d=r.n(m),p=r(9),b=r.n(p),f=r(0),y=r(3),v=r(2),_=r(77),g=r(32),h=r(298),O=r(36),j=r(771),w=r(781),R=r(762),S=r(764);function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,a=b()(e);if(t){var n=b()(this).constructor;r=Reflect.construct(a,arguments,n)}else r=a.apply(this,arguments);return d()(this,r)}}var C=Object(O.g)("manageStock","no"),q=Object(O.g)("stockStatuses",{}),D=function(e){return Object(S.h)(e.extended_info||{})},E=function(e){u()(r,e);var t=k(r);function r(){var e;return n()(this,r),(e=t.call(this)).getHeadersContent=e.getHeadersContent.bind(s()(e)),e.getRowsContent=e.getRowsContent.bind(s()(e)),e.getSummary=e.getSummary.bind(s()(e)),e}return i()(r,[{key:"getHeadersContent",value:function(){return[{label:Object(y.__)("Product / Variation Title",'kkart'),key:"name",required:!0,isLeftAligned:!0},{label:Object(y.__)("SKU",'kkart'),key:"sku",hiddenByDefault:!0,isSortable:!0},{label:Object(y.__)("Items Sold",'kkart'),key:"items_sold",required:!0,defaultSort:!0,isSortable:!0,isNumeric:!0},{label:Object(y.__)("Net Sales",'kkart'),screenReaderLabel:Object(y.__)("Net Sales",'kkart'),key:"net_revenue",required:!0,isSortable:!0,isNumeric:!0},{label:Object(y.__)("Orders",'kkart'),key:"orders_count",isSortable:!0,isNumeric:!0},"yes"===C?{label:Object(y.__)("Status",'kkart'),key:"stock_status"}:null,"yes"===C?{label:Object(y.__)("Stock",'kkart'),key:"stock",isNumeric:!0}:null].filter(Boolean)}},{key:"getRowsContent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.props.query,r=Object(g.getPersistedQuery)(t),a=this.context,n=a.formatAmount,o=a.formatDecimal,i=a.getCurrencyConfig;return Object(v.map)(e,(function(e){var t=e.items_sold,a=e.net_revenue,c=e.orders_count,s=e.product_id,l=e.variation_id,u=e.extended_info||{},m=u.stock_status,d=u.stock_quantity,p=u.low_stock_amount,b=u.sku,v=D(e),j=Object(g.getNewPath)(r,"/analytics/orders",{filter:"advanced",variation_includes:l}),R=Object(O.f)("post.php?post=".concat(s,"&action=edit"));return[{display:Object(f.createElement)(_.Link,{href:R,type:"wp-admin"},v),value:v},{display:b,value:b},{display:Object(h.formatValue)(i(),"number",t),value:t},{display:n(a),value:o(a)},{display:Object(f.createElement)(_.Link,{href:j,type:"kkart-admin"},c),value:c},"yes"===C?{display:Object(w.a)(m,d,p)?Object(f.createElement)(_.Link,{href:R,type:"wp-admin"},Object(y._x)("Low","Indication of a low quantity",'kkart')):q[m],value:q[m]}:null,"yes"===C?{display:d,value:d}:null].filter(Boolean)}))}},{key:"getSummary",value:function(e){var t=e.variations_count,r=void 0===t?0:t,a=e.items_sold,n=void 0===a?0:a,o=e.net_revenue,i=void 0===o?0:o,c=e.orders_count,s=void 0===c?0:c,l=this.context,u=l.formatAmount,m=(0,l.getCurrencyConfig)();return[{label:Object(y._n)("variation sold","variations sold",r,'kkart'),value:Object(h.formatValue)(m,"number",r)},{label:Object(y._n)("item sold","items sold",n,'kkart'),value:Object(h.formatValue)(m,"number",n)},{label:Object(y.__)("net sales",'kkart'),value:u(i)},{label:Object(y._n)("orders","orders",s,'kkart'),value:Object(h.formatValue)(m,"number",s)}]}},{key:"render",value:function(){var e=this.props,t=e.advancedFilters,r=e.baseSearchQuery,a=e.filters,n=e.isRequesting,o=e.query,i={helpText:Object(y.__)("Check at least two variations below to compare",'kkart'),placeholder:Object(y.__)("Search by variation name or SKU",'kkart')};return Object(f.createElement)(j.a,{baseSearchQuery:r,compareBy:"variations",compareParam:"filter-variations",endpoint:"variations",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,isRequesting:n,itemIdField:"variation_id",labels:i,query:o,getSummary:this.getSummary,summaryFields:["variations_count","items_sold","net_revenue","orders_count"],tableQuery:{orderby:o.orderby||"items_sold",order:o.order||"desc",extended_info:!0,products:o.products,variations:o.variations},title:Object(y.__)("Variations",'kkart'),columnPrefsKey:"variations_report_columns",filters:a,advancedFilters:t})}}]),r}(f.Component);E.contextType=R.a,t.a=E}}]);