oont-contents/plugins/currency-switcher-woocommerce/includes/admin/js/analytics.min.js
2025-02-08 15:10:23 +01:00

1 line
No EOL
3.4 KiB
JavaScript

!function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=4)}([function(e,r){e.exports={getLabel:function(){return wpw_currency_switcher.i18n.Currency},getCurrencies:function(){return wpw_currency_switcher.currencies},getPages:function(){return["orders","revenue","products","categories","coupons","taxes"]},getStoreCurrency:function(){return wcSettings.currency.code}}},function(e,r,t){var n=t(5),o=t(6),c=t(7),u=t(8);e.exports=function(e){return n(e)||o(e)||c(e)||u()}},function(e,r){!function(){e.exports=this.wp.hooks}()},function(e,r){e.exports=function(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}},function(e,r,t){"use strict";t.r(r);var n=t(1),o=t.n(n),c=t(2),u=t(0),i="wpwham/currency-switcher-woocommerce/analytics",a=function(e){var r={label:u.getLabel(),staticParams:[],param:"currency",showFilters:function(){return!0},defaultValue:u.getStoreCurrency(),filters:o()(u.getCurrencies()||[])};return[].concat(o()(e),[r])};u.getPages().forEach((function(e){Object(c.addFilter)("woocommerce_admin_".concat(e,"_report_filters"),i,a)}));Object(c.addFilter)("woocommerce_admin_report_table",i,(function(e){if(!(u.getPages().includes(e.endpoint)&&e.items&&e.items.data&&e.items.data.length))return e;var r=[].concat(o()(e.headers),[{label:u.getLabel(),key:"currency"}]),t=e.rows.map((function(r,t){var n=e.items.data[t],c="revenue"===e.endpoint?n.subtotals.currency:n.currency;return[].concat(o()(r),[{display:c,value:c}])}));return e.headers=r,e.rows=t,e}));Object(c.addFilter)("woocommerce_admin_persisted_queries",i,(function(e){return e.push("currency"),e}));Object(c.addFilter)("woocommerce_admin_report_currency",i,(function(e,r){var path=new RegExp('[\?&]path=([^&#]*)').exec(window.location.search);var result=(path!==null)?decodeURIComponent(path[1]):false;if(result==='/analytics/overview'){return e;}var t=r.currency;return t&&(e.code=t,e.symbol=t),e.priceFormat="%2$s",e}))},function(e,r,t){var n=t(3);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,r){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,r,t){var n=t(3);e.exports=function(e,r){if(e){if("string"==typeof e)return n(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,r):void 0}}},function(e,r){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}}]);