Plugin Directory

Changeset 3338013


Ignore:
Timestamp:
08/01/2025 08:45:41 PM (6 months ago)
Author:
bbioon
Message:

version 2.1.5

Location:
merchant
Files:
990 added
16 edited

Legend:

Unmodified
Added
Removed
  • merchant/trunk/admin/classes/class-merchant-admin-menu.php

    r3248005 r3338013  
    301301            // Add 'Upgrade' link.
    302302            if ( ! defined( 'MERCHANT_PRO_VERSION' ) ) {
     303                $url = merchant_admin_upgrade_link(
     304                    'https://athemes.com/merchant-upgrade',
     305                    array(
     306                        'utm_source'   => 'theme_submenu_page',
     307                        'utm_medium'   => 'button',
     308                        'utm_campaign' => 'Merchant',
     309                    ),
     310                    'theme-submenu-page-upgrade-link'
     311                );
    303312                add_submenu_page(
    304313                    $this->plugin_slug,
    305                     esc_html__('Upgrade to Pro', 'merchant'),
    306                     esc_html__('Upgrade to Pro', 'merchant'),
     314                    esc_html__( 'Upgrade to Pro', 'merchant' ),
     315                    esc_html__( 'Upgrade to Pro', 'merchant' ),
    307316                    $this->capability,
    308                     'https://athemes.com/merchant-upgrade?utm_source=theme_submenu_page&utm_medium=button&utm_campaign=Merchant',
     317                    esc_url( $url ),
    309318                    '',
    310             7
     319                    7
    311320                );
    312321            }
     
    393402            // Upgrade to Pro (if not already defined)
    394403            if ( ! defined( 'MERCHANT_PRO_VERSION' ) ) {
     404                $url = merchant_admin_upgrade_link(
     405                    'https://athemes.com/merchant-upgrade',
     406                    array(
     407                        'utm_source'   => 'theme_submenu_page',
     408                        'utm_medium'   => 'button',
     409                        'utm_campaign' => 'Merchant',
     410                    ),
     411                    'adminbar-submenu-page-upgrade-link'
     412                );
    395413                $wp_admin_bar->add_node( array(
    396414                    'id'     => 'merchant-upgrade',
    397415                    'parent' => 'merchant-dashboard',
    398416                    'title'  => esc_html__( 'Upgrade to Pro', 'merchant' ),
    399                     'href'   => 'https://athemes.com/merchant-upgrade?utm_source=theme_submenu_page&utm_medium=button&utm_campaign=Merchant',
     417                    'href'   => esc_url( $url ),
    400418                    'meta'   => array(
    401419                        'title'  => esc_html__( 'Upgrade to Pro', 'merchant' ),
  • merchant/trunk/admin/notices/class-merchant-notice-upsell.php

    r3248005 r3338013  
    4545        }
    4646
     47        $url = merchant_admin_upgrade_link(
     48            'https://athemes.com/merchant-upgrade',
     49            array(
     50                'utm_source'   => 'plugin_notice',
     51                'utm_content'  => 'upgrade_notice',
     52                'utm_medium'   => 'button',
     53                'utm_campaign' => 'Merchant',
     54            ),
     55            'plugin-admin-notice'
     56        );
     57
    4758        ?>
    4859        <div class="merchant-notice merchant-notice-with-thumbnail notice" style="position:relative;">
     
    5566            </p>
    5667
    57             <a href="https://athemes.com/merchant-upgrade?utm_source=plugin_notice&utm_content=upgrade_notice&utm_medium=button&utm_campaign=Merchant" class="merchant-btn merchant-btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade To Merchant Pro', 'merchant' ); ?></a>
     68            <a href="<?php echo esc_url( $url ) ?>" class="merchant-btn merchant-btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade To Merchant Pro', 'merchant' ); ?></a>
    5869           
    5970            <a class="notice-dismiss" href="?<?php echo esc_attr( $this->id ); ?>_dismiss=1" style="text-decoration:none;"></a>
  • merchant/trunk/admin/pages/page-module.php

    r3248005 r3338013  
    6767
    6868
    69                                     <?php if ( $merchant_module_is_upsell ) : ?>
     69                                    <?php if ( $merchant_module_is_upsell ) :
     70                                        $url = merchant_admin_upgrade_link(
     71                                            'https://athemes.com/merchant-upgrade',
     72                                            array(
     73                                                'utm_source'   => 'module_inner_settings',
     74                                                'utm_content'  => $merchant_module,
     75                                                'utm_medium'   => 'merchant_dashboard',
     76                                                'utm_campaign' => 'Merchant',
     77                                            ),
     78                                            'module-inner-settings-upgrade-link'
     79                                        );
     80                                        ?>
    7081                                        <div class="merchant-module-buy">
    7182
    72                                             <a href="https://athemes.com/merchant-upgrade?utm_source=module_inner_settings&utm_content=<?php echo esc_attr( $merchant_module ); ?>&utm_medium=merchant_dashboard&utm_campaign=Merchant" target="_blank"
     83                                            <a href="<?php echo esc_url( $url ); ?>" target="_blank"
    7384                                                class="merchant-module-page-button ">
    7485                                                <?php esc_html_e( 'Buy Pro', 'merchant' ); ?>
  • merchant/trunk/assets/js/admin/analytics.js

    r3320812 r3338013  
    1414function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
    1515function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
    16 function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
     16function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
    1717function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
    1818function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
     
    473473          _t;
    474474        return _regenerator().w(function (_context) {
    475           while (1) switch (_context.n) {
     475          while (1) switch (_context.p = _context.n) {
    476476            case 0:
    477477              loadingIndicatorSelector = _args.length > 1 && _args[1] !== undefined ? _args[1] : '';
     
    539539        var _data$formattedDate, startDate, endDate, response, _t2;
    540540        return _regenerator().w(function (_context2) {
    541           while (1) switch (_context2.n) {
     541          while (1) switch (_context2.p = _context2.n) {
    542542            case 0:
    543543              _data$formattedDate = _slicedToArray(data.formattedDate, 2), startDate = _data$formattedDate[0], endDate = _data$formattedDate[1];
     
    576576        var _data$formattedDate2, startDate, endDate, response, _t3;
    577577        return _regenerator().w(function (_context3) {
    578           while (1) switch (_context3.n) {
     578          while (1) switch (_context3.p = _context3.n) {
    579579            case 0:
    580580              _data$formattedDate2 = _slicedToArray(data.formattedDate, 2), startDate = _data$formattedDate2[0], endDate = _data$formattedDate2[1];
     
    613613        var _data$formattedDate3, startDate, endDate, response, _t4;
    614614        return _regenerator().w(function (_context4) {
    615           while (1) switch (_context4.n) {
     615          while (1) switch (_context4.p = _context4.n) {
    616616            case 0:
    617617              _data$formattedDate3 = _slicedToArray(data.formattedDate, 2), startDate = _data$formattedDate3[0], endDate = _data$formattedDate3[1];
     
    651651        var response, _t5;
    652652        return _regenerator().w(function (_context5) {
    653           while (1) switch (_context5.n) {
     653          while (1) switch (_context5.p = _context5.n) {
    654654            case 0:
    655655              _context5.p = 0;
     
    698698        var response, _t6;
    699699        return _regenerator().w(function (_context6) {
    700           while (1) switch (_context6.n) {
     700          while (1) switch (_context6.p = _context6.n) {
    701701            case 0:
    702702              _context6.p = 0;
     
    734734        var response, _t7;
    735735        return _regenerator().w(function (_context7) {
    736           while (1) switch (_context7.n) {
     736          while (1) switch (_context7.p = _context7.n) {
    737737            case 0:
    738738              _context7.p = 0;
     
    13431343          _t8;
    13441344        return _regenerator().w(function (_context8) {
    1345           while (1) switch (_context8.n) {
     1345          while (1) switch (_context8.p = _context8.n) {
    13461346            case 0:
    13471347              singleRow = _args8.length > 3 && _args8[3] !== undefined ? _args8[3] : false;
  • merchant/trunk/assets/js/admin/analytics.min.js

    r3320812 r3338013  
    1 function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var a,n=Object.keys(e);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(e),t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)),n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(a),!0).forEach(function(t){_defineProperty(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function _defineProperty(t,e,a){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0===a)return("string"===e?String:Number)(t);a=a.call(t,e||"default");if("object"!=_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){var a;if(t)return"string"==typeof t?_arrayLikeToArray(t,e):"Map"===(a="Object"===(a={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:a)||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,e):void 0}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=Array(e);a<e;a++)n[a]=t[a];return n}function _iterableToArrayLimit(t,e){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var n,r,o,i,s=[],c=!0,l=!1;try{if(o=(a=a.call(t)).next,0===e){if(Object(a)!==a)return;c=!1}else for(;!(c=(n=o.call(a)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){l=!0,r=t}finally{try{if(!c&&null!=a.return&&(i=a.return(),Object(i)!==i))return}finally{if(l)throw r}}return s}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _regenerator(){var f,t="function"==typeof Symbol?Symbol:{},e=t.iterator||"@@iterator",a=t.toStringTag||"@@toStringTag";function n(t,e,a,n){var r,o,i,s,c,l,d,p,u,e=e&&e.prototype instanceof m?e:m,e=Object.create(e.prototype);return _regeneratorDefine2(e,"_invoke",(r=t,o=a,d=n||[],p=!1,u={p:l=0,n:0,v:f,a:h,f:h.bind(f,4),d:function(t,e){return i=t,s=0,c=f,u.n=e,g}},function(t,e,a){if(1<l)throw TypeError("Generator is already running");for(p&&1===e&&h(e,a),s=e,c=a;(v=s<2?f:c)||!p;){i||(s?s<3?(1<s&&(u.n=-1),h(s,c)):u.n=c:u.v=c);try{if(l=2,i){if(v=i[t=s?t:"next"]){if(!(v=v.call(i,c)))throw TypeError("iterator result is not an object");if(!v.done)return v;c=v.value,s<2&&(s=0)}else 1===s&&(v=i.return)&&v.call(i),s<2&&(c=TypeError("The iterator does not provide a '"+t+"' method"),s=1);i=f}else if((v=(p=u.n<0)?c:r.call(o,u))!==g)break}catch(t){i=f,s=1,c=t}finally{l=1}}return{value:v,done:p}}),!0),e;function h(t,e){for(s=t,c=e,v=0;!p&&l&&!a&&v<d.length;v++){var a,n=d[v],r=u.p,o=n[2];3<t?(a=o===e)&&(c=n[(s=n[4])?5:s=3],n[4]=n[5]=f):n[0]<=r&&((a=t<2&&r<n[1])?(s=0,u.v=e,u.n=n[1]):r<o&&(a=t<3||n[0]>e||o<e)&&(n[4]=t,n[5]=e,u.n=o,s=0))}if(a||1<t)return g;throw p=!0,e}}var g={};function m(){}function r(){}function o(){}var v=Object.getPrototypeOf,t=[][e]?v(v([][e]())):(_regeneratorDefine2(v={},e,function(){return this}),v),i=o.prototype=m.prototype=Object.create(t);function s(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,o):(t.__proto__=o,_regeneratorDefine2(t,a,"GeneratorFunction")),t.prototype=Object.create(i),t}return _regeneratorDefine2(i,"constructor",r.prototype=o),_regeneratorDefine2(o,"constructor",r),_regeneratorDefine2(o,a,r.displayName="GeneratorFunction"),_regeneratorDefine2(i),_regeneratorDefine2(i,a,"Generator"),_regeneratorDefine2(i,e,function(){return this}),_regeneratorDefine2(i,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:n,m:s}})()}function _regeneratorDefine2(t,e,a,n){var r=Object.defineProperty;try{r({},"",{})}catch(t){r=0}(_regeneratorDefine2=function(t,e,a,n){e?r?r(t,e,{value:a,enumerable:!n,configurable:!n,writable:!n}):t[e]=a:((n=function(e,a){_regeneratorDefine2(t,e,function(t){return this._invoke(e,a,t)})})("next",0),n("throw",1),n("return",2))})(t,e,a,n)}function asyncGeneratorStep(t,e,a,n,r,o,i){try{var s=t[o](i),c=s.value}catch(t){return void a(t)}s.done?e(c):Promise.resolve(c).then(n,r)}function _asyncToGenerator(s){return function(){var t=this,i=arguments;return new Promise(function(e,a){var n=s.apply(t,i);function r(t){asyncGeneratorStep(n,e,a,r,o,"next",t)}function o(t){asyncGeneratorStep(n,e,a,r,o,"throw",t)}r(void 0)})}}(l=>{var n,e,a,r,o,i,s,c,d={AJAX_URL:merchant_analytics.ajax_url,NONCE:merchant_analytics.nonce,impressionsChart:null,revenueChart:null,avgOrderValChart:null,columnChartOptions:{series:[{data:[]}],noData:{text:"No data available",align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:"#686868",fontSize:"18px"}},chart:{type:"bar",height:350,stacked:!1,toolbar:{show:!1,offsetX:-10,offsetY:10,tools:{download:!1,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!1,reset:!0}},zoom:{enabled:!1,allowMouseWheelZoom:!1}},plotOptions:{bar:{columnWidth:"20%",borderRadius:5,borderRadiusApplication:"end",colors:{backgroundBarColors:["#ebeffd"],backgroundBarRadius:4}}},colors:["#3A63E9"],dataLabels:{enabled:!1},grid:{show:!0,borderColor:"#D8D8D8",strokeDashArray:5,position:"back",xaxis:{lines:{show:!0,offsetX:60,style:{dashArray:5}}},yaxis:{lines:{show:!1}}},xaxis:{axisTicks:{show:!1},axisBorder:{show:!0,color:"#D8D8D8",height:1}},tooltip:{enabled:!1}},revenueChartOptions:{series:[{data:[]}],noData:{text:"No data available",align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:"#686868",fontSize:"18px"}},legend:{show:!1},chart:{type:"area",height:350,stacked:!1,toolbar:{show:!1,offsetX:-10,offsetY:10,tools:{download:!1,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!1,reset:!0}},zoom:{enabled:!1,allowMouseWheelZoom:!1}},stroke:{curve:"smooth",dashArray:6,width:2,lineCap:"round"},fill:{type:"gradient",gradient:{inverseColors:!1,opacityFrom:.55,opacityTo:.05,stops:[10,100]}},markers:{size:5,colors:["#fff"],strokeColors:"#3A63E9",strokeWidth:2,hover:{size:6}},colors:["#3A63E9","#393939"],dataLabels:{enabled:!1},grid:{show:!0,borderColor:"#D8D8D8",strokeDashArray:5,position:"back",xaxis:{lines:{show:!0,offsetX:60,style:{dashArray:5}}},yaxis:{lines:{show:!1}}},xaxis:{axisTicks:{show:!1},axisBorder:{show:!0,color:"#D8D8D8",height:1},tooltip:{enabled:!1}},tooltip:{fixed:{offsetX:0,offsetY:0},enabled:!0,theme:!1,custom:function(t){t.series;t=t.w.globals.initialSeries[t.seriesIndex].data[t.dataPointIndex];return'\n                        <div class="arrow-box">\n                            <div class="box-wrapper">\n                                <div class="box-column big">\n                                    <div class="head">\n                                        <div class="box-title">Total Income</div>\n                                        <div class="box-value">'.concat(t.number_currency,'</div>\n                                    </div>\n                                    <div class="orders-count">\n                                        <strong>').concat(t.orders_count,"</strong> ").concat(merchant_analytics.labels.orders,'\n                                    </div>\n                                </div>\n                                <div class="separator"></div>\n                                <div class="box-column small">\n                                    <div class="head">\n                                        <svg width="64" height="47" viewBox="0 0 64 41" fill="none" xmlns="http://www.w3.org/2000/svg">\n                                            \x3c!-- SVG content --\x3e\n                                        </svg>\n                                    </div>\n                                    <div class="change-percentage ').concat(t.diff_type,'">\n                                        <strong>').concat(t.difference,"%</strong>\n                                    </div>\n                                </div>\n                            </div>\n                        </div>")}}},widgetChartOptions:{series:[{data:[]}],noData:{text:"No data available",align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:"#686868",fontSize:"18px"}},legend:{show:!1},chart:{type:"area",height:350,stacked:!1,toolbar:{show:!1,offsetX:-10,offsetY:10,tools:{download:!1,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!1,reset:!0}},zoom:{enabled:!1,allowMouseWheelZoom:!1}},stroke:{curve:"smooth",width:2,lineCap:"round"},fill:{type:"gradient",colors:["#3A63E9"],gradient:{inverseColors:!1,opacityFrom:.55,opacityTo:.15,stops:[10,100]}},colors:["#3A63E9"],dataLabels:{enabled:!1},grid:{show:!0,borderColor:"#D8D8D8",strokeDashArray:5,position:"back",xaxis:{lines:{show:!0,offsetX:60,style:{dashArray:5}}},yaxis:{lines:{show:!1}}},xaxis:{axisTicks:{show:!1},axisBorder:{show:!0,color:"#D8D8D8",height:1},tooltip:{enabled:!1}},tooltip:{enabled:!1}},avgOrderValChartOptions:{series:[{data:[]}],noData:{text:"No data available",align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:"#686868",fontSize:"18px"}},chart:{type:"area",height:350,stacked:!1,toolbar:{show:!1,offsetX:-10,offsetY:10,tools:{download:!1,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!1,reset:!0}},zoom:{enabled:!1,allowMouseWheelZoom:!1}},stroke:{curve:"straight",dashArray:6,width:2},fill:{type:"gradient",gradient:{inverseColors:!1,opacityFrom:.55,opacityTo:.05,stops:[10,100]}},markers:{size:5,colors:["#fff"],strokeColors:"#7880CA",strokeWidth:2,hover:{size:6}},colors:["#7880CA"],dataLabels:{enabled:!1},grid:{show:!0,borderColor:"#D8D8D8",strokeDashArray:5,position:"back",xaxis:{lines:{show:!0,offsetX:60,style:{dashArray:5}}},yaxis:{lines:{show:!1}}},xaxis:{axisTicks:{show:!1},axisBorder:{show:!0,color:"#D8D8D8",height:1},tooltip:{enabled:!1}},tooltip:{enabled:!0,theme:!1,custom:function(t){t.series;t=t.w.globals.initialSeries[t.seriesIndex].data[t.dataPointIndex];return'\n                        <div class="arrow-box-aov">\n                            <div class="box-title">'.concat(merchant_analytics.labels.orders_aov,'</div>\n                            <div class="box-value">').concat(t.number_currency,' <span class="diff ').concat(t.diff_type,'">').concat(t.difference,"%</span></div>\n                        </div>")}}},sendAjaxRequest:(c=_asyncToGenerator(_regenerator().m(function t(e){var a,n,r=arguments;return _regenerator().w(function(t){for(;;)switch(t.n){case 0:return a=1<r.length&&void 0!==r[1]?r[1]:"",n=2<r.length&&void 0!==r[2]?r[2]:"GET",t.p=1,a&&l(a).addClass("show"),t.n=2,l.ajax({url:this.AJAX_URL,method:n,data:e});case 2:return t.a(2,t.v);case 3:throw t.p=3,n=t.v,console.error("AJAX request failed:",n),n;case 4:return t.p=4,a&&l(a).removeClass("show"),t.f(4);case 5:return t.a(2)}},t,this,[[1,3,4,5]])})),function(t){return c.apply(this,arguments)}),prepareAjaxData:function(t,e,a){return{action:t,nonce:this.NONCE,start_date:e,end_date:a,compare_start_date:3<arguments.length&&void 0!==arguments[3]?arguments[3]:"",compare_end_date:4<arguments.length&&void 0!==arguments[4]?arguments[4]:""}},updateImpressionsChart:(s=_asyncToGenerator(_regenerator().m(function t(e){var a,n;return _regenerator().w(function(t){for(;;)switch(t.n){case 0:return n=_slicedToArray(e.formattedDate,2),a=n[0],n=n[1],t.p=1,t.n=2,this.sendAjaxRequest(this.prepareAjaxData("merchant_get_impressions_chart_data",a,n),".impressions-chart-section .merchant-analytics-loading-spinner");case 2:(a=t.v).success&&this.impressionsChart.updateSeries([{data:a.data}]),t.n=4;break;case 3:t.p=3,n=t.v,console.error("Error fetching impressions data:",n);case 4:return t.a(2)}},t,this,[[1,3]])})),function(t){return s.apply(this,arguments)}),updateRevenueChart:(i=_asyncToGenerator(_regenerator().m(function t(e){var a,n;return _regenerator().w(function(t){for(;;)switch(t.n){case 0:return n=_slicedToArray(e.formattedDate,2),a=n[0],n=n[1],t.p=1,t.n=2,this.sendAjaxRequest(this.prepareAjaxData("merchant_get_revenue_chart_data",a,n),".revenue-chart-section .merchant-analytics-loading-spinner");case 2:(a=t.v).success&&this.revenueChart.updateSeries([{data:a.data}]),t.n=4;break;case 3:t.p=3,n=t.v,console.error("Error fetching revenue data:",n);case 4:return t.a(2)}},t,this,[[1,3]])})),function(t){return i.apply(this,arguments)}),updateAOVChart:(o=_asyncToGenerator(_regenerator().m(function t(e){var a,n;return _regenerator().w(function(t){for(;;)switch(t.n){case 0:return n=_slicedToArray(e.formattedDate,2),a=n[0],n=n[1],t.p=1,t.n=2,this.sendAjaxRequest(this.prepareAjaxData("merchant_get_avg_order_value_chart_data",a,n),".aov-chart-section .merchant-analytics-loading-spinner");case 2:(a=t.v).success&&this.avgOrderValChart.updateSeries([{data:a.data}]),t.n=4;break;case 3:t.p=3,n=t.v,console.error("Error fetching AOV data:",n);case 4:return t.a(2)}},t,this,[[1,3]])})),function(t){return o.apply(this,arguments)}),updateOverviewCards:(r=_asyncToGenerator(_regenerator().m(function t(e){var a;return _regenerator().w(function(t){for(;;)switch(t.n){case 0:return t.p=0,t.n=1,this.sendAjaxRequest(this.prepareAjaxData(l(".merchant-analytics-overview-section").attr("data-action"),e.startDate,e.endDate,e.compareStartDate,e.compareEndDate),".merchant-analytics-overview-section .merchant-analytics-loading-spinner");case 1:(a=t.v).success&&this.updateCardsWithData(a.data),t.n=3;break;case 2:t.p=2,a=t.v,console.error("Error fetching cards data:",a);case 3:return t.a(2)}},t,this,[[0,2]])})),function(t){return r.apply(this,arguments)}),updateCardsWithData:function(t){l(".merchant-analytics-overview-section").find(".overview-cards").html(t)},updatePerformingCampaignsTable:(a=_asyncToGenerator(_regenerator().m(function t(e){var a;return _regenerator().w(function(t){for(;;)switch(t.n){case 0:return t.p=0,t.n=1,this.sendAjaxRequest(this.prepareAjaxData("merchant_get_top_performing_campaigns_table_data",e.startDate,e.endDate,"",""),".merchant-analytics-overview-section .merchant-analytics-loading-spinner");case 1:(a=t.v).success&&this.updateTopCampaignsWithData(a.data,e.container),t.n=3;break;case 2:t.p=2,a=t.v,console.error("Error fetching cards data:",a);case 3:return t.a(2)}},t,this,[[0,2]])})),function(t){return a.apply(this,arguments)}),updateAllCampaignsTable:(e=_asyncToGenerator(_regenerator().m(function t(e){var a;return _regenerator().w(function(t){for(;;)switch(t.n){case 0:return t.p=0,t.n=1,this.sendAjaxRequest(this.prepareAjaxData("merchant_get_all_campaigns_table_data",e.startDate,e.endDate,"",""),".merchant-page-campaigns .merchant-analytics-loading-spinner");case 1:(a=t.v).success&&(this.updateAllCampaignsWithData(a.data,e.container),this.populateFilterSelect(e.container)),t.n=3;break;case 2:t.p=2,a=t.v,console.error("Error fetching cards data:",a);case 3:return t.a(2)}},t,this,[[0,2]])})),function(t){return e.apply(this,arguments)}),updateTopCampaignsWithData:function(t,e){var a=e.find("tbody");e.find("table th").removeClass("asc desc"),a.empty(),l.each(t,function(t,e){e="\n\t\t            <tr>\n\t\t                <td>".concat(e.campaign_info.module_name,": ").concat(e.campaign_info.campaign_title,"</td>\n\t\t                <td>").concat(e.impressions,"</td>\n\t\t                <td>").concat(e.clicks,'</td>\n\t\t                <td class="ctr">').concat(e.ctr,"</td>\n\t\t                <td>").concat(e.orders,"</td>\n\t\t                <td>").concat(e.revenue,"</td>\n\t\t            </tr>\n\t\t        ");l(a).append(e)})},updateAllCampaignsWithData:function(t,e){var o=[],a=e.find("tbody"),i=(a.empty(),e.find("table th").removeClass("asc desc"),e.find(".js-campaign-search").val(""),e.find(".no-results-message").hide(),0),e=e.find(".js-pagination"),s=parseInt(e.attr("data-rows-per-page"));l.each(t,function(a,n){var r=n.module_id;0<n.campaigns.length&&n.campaigns.forEach(function(t,e){i++;var e="".concat(r,"-campaign-").concat(a,"-").concat(e);o.push('\n\t\t\t\t            <tr\n\t\t\t\t            \tclass="'.concat(s<i?"is-hidden":"",'"\n\t\t\t\t            \t').concat(s<i?'style="display: none;"':"",'\n\t\t\t\t                data-module-id="').concat(r,'"\n\t\t\t\t                data-campaign-key="').concat(t.campaign_key,'"\n\t\t\t\t                data-campaign-id="').concat(t.campaign_id,'"\n\t\t\t\t                data-row-count="').concat(i,'">\n\t\t\t\t                <td><input type="checkbox" name="campaign_select[]" value="').concat(t.title,'" /></td>\n\t\t\t\t                <td class="merchant__campaign-name js-campaign-name">').concat(t.title,'</td>\n\t\t\t\t                <td class="merchant__module-name js-module-name" data-module-id="').concat(n.module_id,'">').concat(n.module_name,'</td>\n\t\t\t\t                <td class="merchant__status merchant-module-page-setting-field-switcher js-status">\n\t\t\t\t                    ').concat("active"===t.status||"inactive"===t.status?'<div class="merchant-toggle-switch">\n\t\t\t\t\t\t\t\t                <input type="checkbox" id="'.concat(e,'" name="merchant[').concat(e,']" value="').concat("active"===t.status?"1":"",'" ').concat("active"===t.status?"checked ":"",'class="toggle-switch-checkbox">\n\t\t\t\t\t\t\t\t                <label class="toggle-switch-label" for="').concat(e,'">\n\t\t\t\t\t\t\t\t                    <span class="toggle-switch-inner"></span>\n\t\t\t\t\t\t\t\t                    <span class="toggle-switch-switch"></span>\n\t\t\t\t\t\t\t\t                </label>\n\t\t\t\t\t\t\t\t\t\t\t</div>'):"-",'\n\t\t\t\t                </td>\n\t\t\t\t                <td class="merchant__impressions">').concat(t.impression,'</td>\n\t\t\t\t                <td class="merchant__clicks">').concat(t.clicks,'</td>\n\t\t\t\t                <td class="merchant__revenue">').concat(null!=(e=t.revenue)?e:"-",'</td>\n\t\t\t\t                <td class="merchant__ctr">').concat(t.ctr,'</td>\n\t\t\t\t                <td class="merchant__orders">').concat(t.orders,'</td>\n\t\t\t\t                <td class="merchant__edit">\n\t\t\t\t                    <a href="').concat(n.edit_url||"#",'" target="_blank">\n\t\t\t\t                        <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none">\n\t\t\t\t                            <path d="M8.30399 1.00174C8.90067 0.405063 9.8596 0.405063 10.4563 1.00174L10.7333 1.27876C11.33 1.87543 11.33 2.83437 10.7333 3.43104L6.51398 7.65037C6.3435 7.82085 6.10909 7.97001 5.85338 8.03394L3.7224 8.65192C3.55193 8.69454 3.36014 8.65192 3.23228 8.50276C3.08311 8.3749 3.04049 8.18311 3.08311 8.01263L3.70109 5.88166C3.76502 5.62594 3.91419 5.39154 4.08467 5.22106L8.30399 1.00174ZM9.73175 1.72627C9.53996 1.53448 9.22031 1.53448 9.02852 1.72627L8.38923 2.34425L9.39079 3.3458L10.0088 2.70651C10.2006 2.51473 10.2006 2.19508 10.0088 2.00329L9.73175 1.72627ZM4.68134 6.15869L4.31908 7.41596L5.57635 7.0537C5.66159 7.03239 5.72552 6.98977 5.78945 6.92584L8.66626 4.04903L7.68601 3.06878L4.8092 5.94559C4.74527 6.00952 4.70265 6.07345 4.68134 6.15869ZM4.61741 1.83281C4.89444 1.83281 5.12885 2.06722 5.12885 2.34425C5.12885 2.64258 4.89444 2.85568 4.61741 2.85568H2.23072C1.7406 2.85568 1.37834 3.23926 1.37834 3.70807V9.50431C1.37834 9.99444 1.7406 10.3567 2.23072 10.3567H8.02697C8.49578 10.3567 8.87936 9.99444 8.87936 9.50431V7.11763C8.87936 6.8406 9.09245 6.60619 9.39079 6.60619C9.66782 6.60619 9.90222 6.8406 9.90222 7.11763V9.50431C9.90222 10.5485 9.04983 11.3796 8.02697 11.3796H2.23072C1.18655 11.3796 0.355469 10.5485 0.355469 9.50431V3.70807C0.355469 2.6852 1.18655 1.83281 2.23072 1.83281H4.61741Z" fill="#565865"/>\n\t\t\t\t                        </svg>\n\t\t\t\t                        Edit\n\t\t\t\t                    </a>\n\t\t\t\t                </td>\n\t\t\t\t            </tr>\n\t\t\t\t        '))})}),l(a).append(o.join("")),this.updatePaginationButtons(1,parseInt(e.attr("data-total-pages-initial")),parseInt(e.attr("data-total-rows-initial")))},datePickerInit:function(t,e){var n=e.onSelectHandler,r=e.datePickerArgs,e=t.find(".date-range-input");e.length&&e.each(function(){var t=l(this),e=t.val(),a=[],e=(e&&(a=e.split(" - ").map(function(t){return new Date(t.trim())})),_objectSpread(_objectSpread({},{maxDate:new Date,locale:JSON.parse(merchant_datepicker_locale),range:!0,position:"bottom right",dateFormat:"MM/dd/yy",selectedDates:a,multipleDatesSeparator:" - ",onSelect:function(t){"function"==typeof n&&n(t)}}),r));new AirDatepicker(t.get(0),e)})},initOverviewCards:function(){var a=this,n=l(".merchant-analytics-overview-section");this.datePickerInit(n,{onSelectHandler:function(){var t=n.find(".first-date-range .date-range-input"),e=n.find(".second-date-range .date-range-input"),t=t.val().split(" - ").map(function(t){return t.trim()}),e=e.val().split(" - ").map(function(t){return t.trim()});2===t.length&&2===e.length&&a.updateOverviewCards({startDate:t[0],endDate:t[1],compareStartDate:e[0],compareEndDate:e[1]})}})},renderChart:function(t,e,a,n){var r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},o=t.find(".chart");if(o.length)return(e=new ApexCharts(o.get(0),e)).render(),e.updateSeries([{data:JSON.parse(o.attr("data-period"))}]),this.datePickerInit(t,{onSelectHandler:function(t){2===t.formattedDate.length&&a(t)},datePickerArgs:r}),e},widgetChartRender:function(){var e=this,t=l(".widget-chart-section"),a=l("body").hasClass("rtl");d.revenueChart=this.renderChart(t,this.widgetChartOptions,function(t){return e.updateRevenueChart(t)},".widget-chart-section .merchant-analytics-loading-spinner",{position:a?"top right":"top left"})},revenueChartRender:function(){var e=this,t=l(".revenue-chart-section");t.length&&(this.revenueChart=this.renderChart(t,this.revenueChartOptions,function(t){return e.updateRevenueChart(t)},".revenue-chart-section .merchant-analytics-loading-spinner"))},avgOrderValChartRender:function(){var e=this,t=l(".aov-chart-section");t.length&&(this.avgOrderValChart=this.renderChart(t,this.avgOrderValChartOptions,function(t){return e.updateAOVChart(t)},".aov-chart-section .merchant-analytics-loading-spinner"))},impressionsChartRender:function(){var e=this,t=l(".impressions-chart-section");t.length&&(this.impressionsChart=this.renderChart(t,this.columnChartOptions,function(t){return e.updateImpressionsChart(t)},".impressions-chart-section .merchant-analytics-loading-spinner"))},initTopCampaignsTable:function(){var e=l(".merchant-analytics-section.campaigns-table"),a=this;e.length&&(this.datePickerInit(e,{onSelectHandler:function(){var t=e.find(".first-date-range .date-range-input").val().split(" - ").map(function(t){return t.trim()});2===t.length&&a.updatePerformingCampaignsTable({startDate:t[0],endDate:t[1],container:e})},datePickerArgs:{position:"top right"}}),this.setupSortableTableEventListeners(e))},initAllCampaignsTable:function(){var e=l(".merchant-analytics-section.all-campaigns-table"),a=this;e.length&&(this.datePickerInit(e,{onSelectHandler:function(){var t=e.find(".first-date-range .date-range-input").val().split(" - ").map(function(t){return t.trim()});2===t.length&&a.updateAllCampaignsTable({startDate:t[0],endDate:t[1],container:e})}}),a.setupSortableTableEventListeners(e),a.populateFilterSelect(e))},populateFilterSelect:function(t){var t=t.find(".js-campaigns-table"),a=l(".filter-campaign select"),n=(l(a).find("option:not(:first)").remove(),[]);l(t).find("tr .js-module-name").each(function(){var e=l(this).attr("data-module-id"),t=l(this).text().trim();e&&!n.some(function(t){return t.value===e})&&n.push({value:e,label:t})}),n.sort(),l.each(n,function(t,e){l(a).append(l("<option>",{value:e.value,text:e.label}))})},setupSortableTableEventListeners:function(e){var r=this,o=(e.find("th:not(.no-sort)").on("click",function(t){r.sortableTable(l(t.currentTarget),e)}),l(".js-campaigns-table")),t=l(".js-campaign-search"),a=l(".js-filter-module"),n=l(".js-bulk-action"),i=l(".js-pagination");o.find('thead th:first-child input[type="checkbox"]').on("change",function(){var t=l(this).prop("checked");o.find('tbody tr:not(.is-hidden) input[type="checkbox"]:not(.toggle-switch-checkbox)').prop("checked",t)}),o.on("change",'.js-status input[type="checkbox"]',function(){var t=l(this),e=t.closest("tr"),e=_defineProperty({},e.attr("data-module-id"),{campaign_key:e.attr("data-campaign-key"),campaigns:[{campaign_id:e.attr("data-campaign-id"),status:t.prop("checked")?"active":"inactive"}]});r.updateCampaignStatus(e,t,[t],!0)}),n.on("click",function(t){t.preventDefault();var a,n=l(this).closest(".bulk-action").find("select").val();n?(t=o.find('tbody tr:not(.is-hidden) input[type="checkbox"]:not(.toggle-switch-checkbox):checked')).length?(a={},t.each(function(){var t=l(this).closest("tr"),e=t.attr("data-module-id");a[e]||(a[e]={campaign_key:t.attr("data-campaign-key"),campaigns:[]}),a[e].campaigns.push({campaign_id:t.attr("data-campaign-id"),status:n})}),r.updateCampaignStatus(a,l(this),t)):alert("Please select campaigns."):alert("Please select an action.")}),t.on("input",r.debounce(function(){r.filterTableTable(a.val(),o,l(this).val())},300)),a.on("change",function(){r.filterTableTable(l(this).val(),o,""),t.val("")}),i.on("click",".pagination-button",function(t){t.preventDefault();var t=parseInt(l(this).attr("data-current-page")),e=parseInt(l(this).attr("data-page"));isNaN(e)||e===t||(r.paginateRows(t=e,o.find("tbody tr")),r.updatePaginationButtons(t))})},sortableTable:function(t,e){var n=t.index(),r=t.data("sort"),o=t.hasClass("asc")?"desc":"asc",t=(e.find("th").removeClass("asc desc"),t.addClass(o),e.find("tbody")),e=t.find("tr").toArray();e.sort(function(t,e){var a,t=l(t).find("td").eq(n).text(),e=l(e).find("td").eq(n).text(),t="int"===r?(a=parseInt(t.replace(/[^0-9]/g,""),10),parseInt(e.replace(/[^0-9]/g,""),10)):"float"===r?(a=parseFloat(t.replace(/[^0-9.]/g,"")),parseFloat(e.replace(/[^0-9.]/g,""))):(a=t,e);return"asc"==o?a<t?-1:t<a?1:0:t<a?-1:a<t?1:0}),t.append(e)},filterTableTable:function(r,t){var o,e,a,n,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"";t.length&&(o=0,(e=t.find("tbody tr")).each(function(){var t=l(this),e=t.attr("data-module-id"),a=t.find(".js-campaign-name").text().toLowerCase(),n=t.find(".js-module-name").text().toLowerCase(),e=!r||e===r,a=!i||a.includes(i)||n.includes(i);e&&a?(t.show().removeClass("filtered-out is-hidden"),o++):t.hide().addClass("filtered-out")}),a=o,n=parseInt(t.closest(".merchant-page-campaigns").find(".js-pagination").attr("data-rows-per-page")),n=Math.max(1,Math.ceil(a/n)),this.paginateRows(1,e),this.updateNoResults(0===o,t),this.updatePaginationButtons(1,n,a))},paginateRows:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,e=1<arguments.length?arguments[1]:void 0,a=l(".js-pagination"),a=parseInt(a.attr("data-rows-per-page")),n=(t-1)*a,r=n+a;e.hide().addClass("is-hidden"),e.filter(":not(.filtered-out)").each(function(t){n<=t&&t<r&&l(this).show().removeClass("is-hidden")})},updateNoResults:function(t,e){var a=e.next(".no-results-message");t?(a.length||(a=l('<div class="no-results-message" style="">No matching campaigns found</div>'),e.after(a)),a.show()):a.length&&a.hide()},updatePaginationButtons:function(t,e,a){var n=l(".js-pagination"),r=(n.attr("data-current-page",t),e&&n.attr("data-total-pages",e),a&&n.attr("data-total-rows",a),e=parseInt(n.attr("data-total-pages")),"");if(1<t&&(r+='\n\t\t          <button class="pagination-button prev-page" data-page="'.concat(t-1,'">\n\t\t            <svg xmlns="http://www.w3.org/2000/svg" width="7" height="12" viewBox="0 0 7 12" fill="#565865">\n\t\t              <path d="M5.16797 11.3301L0.521484 6.48047C0.394531 6.32812 0.34375 6.17578 0.34375 6.02344C0.34375 5.89648 0.394531 5.74414 0.496094 5.61719L5.14258 0.767578C5.37109 0.513672 5.77734 0.513672 6.00586 0.742188C6.25977 0.970703 6.25977 1.35156 6.03125 1.60547L1.79102 6.02344L6.05664 10.4922C6.28516 10.7207 6.28516 11.127 6.03125 11.3555C5.80273 11.584 5.39648 11.584 5.16797 11.3301Z"/>\n\t\t            </svg>\n\t\t          </button>\n\t\t\t\t')),1<e)for(var o=1;o<=e;o++)r+='\n          \t\t\t<button class="pagination-button'.concat(o===t?" pagination-active":"",'" data-page="').concat(o,'">').concat(o,"</button>\n\t\t\t\t");t<e&&(r+='\n\t\t          <button class="pagination-button next-page" data-page="'.concat(t+1,'">\n\t\t            <svg xmlns="http://www.w3.org/2000/svg" width="7" height="12" viewBox="0 0 7 12" fill="#565865">\n\t\t              <path d="M1.80664 0.742188L6.45312 5.5918C6.55469 5.71875 6.63086 5.87109 6.63086 6.02344C6.63086 6.17578 6.55469 6.32812 6.45312 6.42969L1.80664 11.2793C1.57812 11.5332 1.17188 11.5332 0.943359 11.3047C0.689453 11.0762 0.689453 10.6953 0.917969 10.4414L5.18359 5.99805L0.917969 1.58008C0.689453 1.35156 0.689453 0.945312 0.943359 0.716797C1.17188 0.488281 1.57812 0.488281 1.80664 0.742188Z"/>\n\t\t            </svg>\n\t\t          </button>\n\t\t\t\t')),n.html(r);var i,s,c=l(".js-pagination-results");1<e?(i=parseInt(n.attr("data-total-rows")),n=(s=(t-1)*(n=parseInt(n.attr("data-rows-per-page"))))+n,c.find(".pagination-start-row").text(s||1),c.find(".pagination-end-row").text(i<n?i:n),c.find(".pagination-total-rows").text(a),c.show()):c.hide()},updateCampaignStatus:(n=_asyncToGenerator(_regenerator().m(function t(e,a,n){var r,o,i,s,c=arguments;return _regenerator().w(function(t){for(;;)switch(t.n){case 0:return r=3<c.length&&void 0!==c[3]&&c[3],o=this,i=a.closest(".all-campaigns-table").find(".js-campaigns-table"),s='<span class="spinner is-active"></span>',a.prop("disabled",!0),r?(a.closest(".merchant-toggle-switch").append(s),a.closest("tr").css("opacity",".7")):(i.css("opacity",".7"),a.closest(".bulk-action").append(s)),t.p=1,t.n=2,this.sendAjaxRequest({action:"merchant_update_campaign_status",nonce:o.NONCE,campaign_data:e},"","POST").then(function(t){t.success&&(r||null!=n&&n.each(function(){l(this).closest("tr").find('.js-status input[type="checkbox"]').prop("checked","active"===t.data.status)}),l(document).trigger("merchant_campaign_status_updated",[t.data,a,n,r,e])),l(".spinner").remove(),a.prop("disabled",!1),(r?a.closest("tr"):(null!=n&&n.each(function(){i.find('thead th:first-child input[type="checkbox"]').prop("checked",!1),l(this).prop("checked",!1)}),i)).css("opacity","")});case 2:t.n=4;break;case 3:t.p=3,s=t.v,console.error("Error fetching campaign status data:",s);case 4:return t.a(2)}},t,this,[[1,3]])})),function(t,e,a){return n.apply(this,arguments)}),debounce:function(r,o){var i;return function(){for(var t=this,e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];clearTimeout(i),i=setTimeout(function(){return r.apply(t,a)},o)}}};l(document).ready(function(){d.initOverviewCards(),d.widgetChartRender(),d.revenueChartRender(),d.avgOrderValChartRender(),d.impressionsChartRender(),d.initTopCampaignsTable(),d.initAllCampaignsTable()})})(jQuery);
     1function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var a,n=Object.keys(e);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(e),t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)),n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(a),!0).forEach(function(t){_defineProperty(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function _defineProperty(t,e,a){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0===a)return("string"===e?String:Number)(t);a=a.call(t,e||"default");if("object"!=_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){var a;if(t)return"string"==typeof t?_arrayLikeToArray(t,e):"Map"===(a="Object"===(a={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:a)||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,e):void 0}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=Array(e);a<e;a++)n[a]=t[a];return n}function _iterableToArrayLimit(t,e){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var n,r,o,i,s=[],c=!0,l=!1;try{if(o=(a=a.call(t)).next,0===e){if(Object(a)!==a)return;c=!1}else for(;!(c=(n=o.call(a)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){l=!0,r=t}finally{try{if(!c&&null!=a.return&&(i=a.return(),Object(i)!==i))return}finally{if(l)throw r}}return s}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _regenerator(){var f,t="function"==typeof Symbol?Symbol:{},e=t.iterator||"@@iterator",a=t.toStringTag||"@@toStringTag";function n(t,e,a,n){var r,o,i,s,c,l,d,p,u,e=e&&e.prototype instanceof m?e:m,e=Object.create(e.prototype);return _regeneratorDefine2(e,"_invoke",(r=t,o=a,d=n||[],p=!1,u={p:l=0,n:0,v:f,a:h,f:h.bind(f,4),d:function(t,e){return i=t,s=0,c=f,u.n=e,g}},function(t,e,a){if(1<l)throw TypeError("Generator is already running");for(p&&1===e&&h(e,a),s=e,c=a;(v=s<2?f:c)||!p;){i||(s?s<3?(1<s&&(u.n=-1),h(s,c)):u.n=c:u.v=c);try{if(l=2,i){if(v=i[t=s?t:"next"]){if(!(v=v.call(i,c)))throw TypeError("iterator result is not an object");if(!v.done)return v;c=v.value,s<2&&(s=0)}else 1===s&&(v=i.return)&&v.call(i),s<2&&(c=TypeError("The iterator does not provide a '"+t+"' method"),s=1);i=f}else if((v=(p=u.n<0)?c:r.call(o,u))!==g)break}catch(t){i=f,s=1,c=t}finally{l=1}}return{value:v,done:p}}),!0),e;function h(t,e){for(s=t,c=e,v=0;!p&&l&&!a&&v<d.length;v++){var a,n=d[v],r=u.p,o=n[2];3<t?(a=o===e)&&(c=n[(s=n[4])?5:s=3],n[4]=n[5]=f):n[0]<=r&&((a=t<2&&r<n[1])?(s=0,u.v=e,u.n=n[1]):r<o&&(a=t<3||n[0]>e||o<e)&&(n[4]=t,n[5]=e,u.n=o,s=0))}if(a||1<t)return g;throw p=!0,e}}var g={};function m(){}function r(){}function o(){}var v=Object.getPrototypeOf,t=[][e]?v(v([][e]())):(_regeneratorDefine2(v={},e,function(){return this}),v),i=o.prototype=m.prototype=Object.create(t);function s(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,o):(t.__proto__=o,_regeneratorDefine2(t,a,"GeneratorFunction")),t.prototype=Object.create(i),t}return _regeneratorDefine2(i,"constructor",r.prototype=o),_regeneratorDefine2(o,"constructor",r),_regeneratorDefine2(o,a,r.displayName="GeneratorFunction"),_regeneratorDefine2(i),_regeneratorDefine2(i,a,"Generator"),_regeneratorDefine2(i,e,function(){return this}),_regeneratorDefine2(i,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:n,m:s}})()}function _regeneratorDefine2(t,e,a,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}(_regeneratorDefine2=function(t,e,a,n){function r(e,a){_regeneratorDefine2(t,e,function(t){return this._invoke(e,a,t)})}e?o?o(t,e,{value:a,enumerable:!n,configurable:!n,writable:!n}):t[e]=a:(r("next",0),r("throw",1),r("return",2))})(t,e,a,n)}function asyncGeneratorStep(t,e,a,n,r,o,i){try{var s=t[o](i),c=s.value}catch(t){return void a(t)}s.done?e(c):Promise.resolve(c).then(n,r)}function _asyncToGenerator(s){return function(){var t=this,i=arguments;return new Promise(function(e,a){var n=s.apply(t,i);function r(t){asyncGeneratorStep(n,e,a,r,o,"next",t)}function o(t){asyncGeneratorStep(n,e,a,r,o,"throw",t)}r(void 0)})}}(l=>{var n,e,a,r,o,i,s,c,d={AJAX_URL:merchant_analytics.ajax_url,NONCE:merchant_analytics.nonce,impressionsChart:null,revenueChart:null,avgOrderValChart:null,columnChartOptions:{series:[{data:[]}],noData:{text:"No data available",align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:"#686868",fontSize:"18px"}},chart:{type:"bar",height:350,stacked:!1,toolbar:{show:!1,offsetX:-10,offsetY:10,tools:{download:!1,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!1,reset:!0}},zoom:{enabled:!1,allowMouseWheelZoom:!1}},plotOptions:{bar:{columnWidth:"20%",borderRadius:5,borderRadiusApplication:"end",colors:{backgroundBarColors:["#ebeffd"],backgroundBarRadius:4}}},colors:["#3A63E9"],dataLabels:{enabled:!1},grid:{show:!0,borderColor:"#D8D8D8",strokeDashArray:5,position:"back",xaxis:{lines:{show:!0,offsetX:60,style:{dashArray:5}}},yaxis:{lines:{show:!1}}},xaxis:{axisTicks:{show:!1},axisBorder:{show:!0,color:"#D8D8D8",height:1}},tooltip:{enabled:!1}},revenueChartOptions:{series:[{data:[]}],noData:{text:"No data available",align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:"#686868",fontSize:"18px"}},legend:{show:!1},chart:{type:"area",height:350,stacked:!1,toolbar:{show:!1,offsetX:-10,offsetY:10,tools:{download:!1,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!1,reset:!0}},zoom:{enabled:!1,allowMouseWheelZoom:!1}},stroke:{curve:"smooth",dashArray:6,width:2,lineCap:"round"},fill:{type:"gradient",gradient:{inverseColors:!1,opacityFrom:.55,opacityTo:.05,stops:[10,100]}},markers:{size:5,colors:["#fff"],strokeColors:"#3A63E9",strokeWidth:2,hover:{size:6}},colors:["#3A63E9","#393939"],dataLabels:{enabled:!1},grid:{show:!0,borderColor:"#D8D8D8",strokeDashArray:5,position:"back",xaxis:{lines:{show:!0,offsetX:60,style:{dashArray:5}}},yaxis:{lines:{show:!1}}},xaxis:{axisTicks:{show:!1},axisBorder:{show:!0,color:"#D8D8D8",height:1},tooltip:{enabled:!1}},tooltip:{fixed:{offsetX:0,offsetY:0},enabled:!0,theme:!1,custom:function(t){t.series;t=t.w.globals.initialSeries[t.seriesIndex].data[t.dataPointIndex];return'\n                        <div class="arrow-box">\n                            <div class="box-wrapper">\n                                <div class="box-column big">\n                                    <div class="head">\n                                        <div class="box-title">Total Income</div>\n                                        <div class="box-value">'.concat(t.number_currency,'</div>\n                                    </div>\n                                    <div class="orders-count">\n                                        <strong>').concat(t.orders_count,"</strong> ").concat(merchant_analytics.labels.orders,'\n                                    </div>\n                                </div>\n                                <div class="separator"></div>\n                                <div class="box-column small">\n                                    <div class="head">\n                                        <svg width="64" height="47" viewBox="0 0 64 41" fill="none" xmlns="http://www.w3.org/2000/svg">\n                                            \x3c!-- SVG content --\x3e\n                                        </svg>\n                                    </div>\n                                    <div class="change-percentage ').concat(t.diff_type,'">\n                                        <strong>').concat(t.difference,"%</strong>\n                                    </div>\n                                </div>\n                            </div>\n                        </div>")}}},widgetChartOptions:{series:[{data:[]}],noData:{text:"No data available",align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:"#686868",fontSize:"18px"}},legend:{show:!1},chart:{type:"area",height:350,stacked:!1,toolbar:{show:!1,offsetX:-10,offsetY:10,tools:{download:!1,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!1,reset:!0}},zoom:{enabled:!1,allowMouseWheelZoom:!1}},stroke:{curve:"smooth",width:2,lineCap:"round"},fill:{type:"gradient",colors:["#3A63E9"],gradient:{inverseColors:!1,opacityFrom:.55,opacityTo:.15,stops:[10,100]}},colors:["#3A63E9"],dataLabels:{enabled:!1},grid:{show:!0,borderColor:"#D8D8D8",strokeDashArray:5,position:"back",xaxis:{lines:{show:!0,offsetX:60,style:{dashArray:5}}},yaxis:{lines:{show:!1}}},xaxis:{axisTicks:{show:!1},axisBorder:{show:!0,color:"#D8D8D8",height:1},tooltip:{enabled:!1}},tooltip:{enabled:!1}},avgOrderValChartOptions:{series:[{data:[]}],noData:{text:"No data available",align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:"#686868",fontSize:"18px"}},chart:{type:"area",height:350,stacked:!1,toolbar:{show:!1,offsetX:-10,offsetY:10,tools:{download:!1,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!1,reset:!0}},zoom:{enabled:!1,allowMouseWheelZoom:!1}},stroke:{curve:"straight",dashArray:6,width:2},fill:{type:"gradient",gradient:{inverseColors:!1,opacityFrom:.55,opacityTo:.05,stops:[10,100]}},markers:{size:5,colors:["#fff"],strokeColors:"#7880CA",strokeWidth:2,hover:{size:6}},colors:["#7880CA"],dataLabels:{enabled:!1},grid:{show:!0,borderColor:"#D8D8D8",strokeDashArray:5,position:"back",xaxis:{lines:{show:!0,offsetX:60,style:{dashArray:5}}},yaxis:{lines:{show:!1}}},xaxis:{axisTicks:{show:!1},axisBorder:{show:!0,color:"#D8D8D8",height:1},tooltip:{enabled:!1}},tooltip:{enabled:!0,theme:!1,custom:function(t){t.series;t=t.w.globals.initialSeries[t.seriesIndex].data[t.dataPointIndex];return'\n                        <div class="arrow-box-aov">\n                            <div class="box-title">'.concat(merchant_analytics.labels.orders_aov,'</div>\n                            <div class="box-value">').concat(t.number_currency,' <span class="diff ').concat(t.diff_type,'">').concat(t.difference,"%</span></div>\n                        </div>")}}},sendAjaxRequest:(c=_asyncToGenerator(_regenerator().m(function t(e){var a,n,r=arguments;return _regenerator().w(function(t){for(;;)switch(t.p=t.n){case 0:return a=1<r.length&&void 0!==r[1]?r[1]:"",n=2<r.length&&void 0!==r[2]?r[2]:"GET",t.p=1,a&&l(a).addClass("show"),t.n=2,l.ajax({url:this.AJAX_URL,method:n,data:e});case 2:return t.a(2,t.v);case 3:throw t.p=3,n=t.v,console.error("AJAX request failed:",n),n;case 4:return t.p=4,a&&l(a).removeClass("show"),t.f(4);case 5:return t.a(2)}},t,this,[[1,3,4,5]])})),function(t){return c.apply(this,arguments)}),prepareAjaxData:function(t,e,a){return{action:t,nonce:this.NONCE,start_date:e,end_date:a,compare_start_date:3<arguments.length&&void 0!==arguments[3]?arguments[3]:"",compare_end_date:4<arguments.length&&void 0!==arguments[4]?arguments[4]:""}},updateImpressionsChart:(s=_asyncToGenerator(_regenerator().m(function t(e){var a,n;return _regenerator().w(function(t){for(;;)switch(t.p=t.n){case 0:return n=_slicedToArray(e.formattedDate,2),a=n[0],n=n[1],t.p=1,t.n=2,this.sendAjaxRequest(this.prepareAjaxData("merchant_get_impressions_chart_data",a,n),".impressions-chart-section .merchant-analytics-loading-spinner");case 2:(a=t.v).success&&this.impressionsChart.updateSeries([{data:a.data}]),t.n=4;break;case 3:t.p=3,n=t.v,console.error("Error fetching impressions data:",n);case 4:return t.a(2)}},t,this,[[1,3]])})),function(t){return s.apply(this,arguments)}),updateRevenueChart:(i=_asyncToGenerator(_regenerator().m(function t(e){var a,n;return _regenerator().w(function(t){for(;;)switch(t.p=t.n){case 0:return n=_slicedToArray(e.formattedDate,2),a=n[0],n=n[1],t.p=1,t.n=2,this.sendAjaxRequest(this.prepareAjaxData("merchant_get_revenue_chart_data",a,n),".revenue-chart-section .merchant-analytics-loading-spinner");case 2:(a=t.v).success&&this.revenueChart.updateSeries([{data:a.data}]),t.n=4;break;case 3:t.p=3,n=t.v,console.error("Error fetching revenue data:",n);case 4:return t.a(2)}},t,this,[[1,3]])})),function(t){return i.apply(this,arguments)}),updateAOVChart:(o=_asyncToGenerator(_regenerator().m(function t(e){var a,n;return _regenerator().w(function(t){for(;;)switch(t.p=t.n){case 0:return n=_slicedToArray(e.formattedDate,2),a=n[0],n=n[1],t.p=1,t.n=2,this.sendAjaxRequest(this.prepareAjaxData("merchant_get_avg_order_value_chart_data",a,n),".aov-chart-section .merchant-analytics-loading-spinner");case 2:(a=t.v).success&&this.avgOrderValChart.updateSeries([{data:a.data}]),t.n=4;break;case 3:t.p=3,n=t.v,console.error("Error fetching AOV data:",n);case 4:return t.a(2)}},t,this,[[1,3]])})),function(t){return o.apply(this,arguments)}),updateOverviewCards:(r=_asyncToGenerator(_regenerator().m(function t(e){var a;return _regenerator().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.sendAjaxRequest(this.prepareAjaxData(l(".merchant-analytics-overview-section").attr("data-action"),e.startDate,e.endDate,e.compareStartDate,e.compareEndDate),".merchant-analytics-overview-section .merchant-analytics-loading-spinner");case 1:(a=t.v).success&&this.updateCardsWithData(a.data),t.n=3;break;case 2:t.p=2,a=t.v,console.error("Error fetching cards data:",a);case 3:return t.a(2)}},t,this,[[0,2]])})),function(t){return r.apply(this,arguments)}),updateCardsWithData:function(t){l(".merchant-analytics-overview-section").find(".overview-cards").html(t)},updatePerformingCampaignsTable:(a=_asyncToGenerator(_regenerator().m(function t(e){var a;return _regenerator().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.sendAjaxRequest(this.prepareAjaxData("merchant_get_top_performing_campaigns_table_data",e.startDate,e.endDate,"",""),".merchant-analytics-overview-section .merchant-analytics-loading-spinner");case 1:(a=t.v).success&&this.updateTopCampaignsWithData(a.data,e.container),t.n=3;break;case 2:t.p=2,a=t.v,console.error("Error fetching cards data:",a);case 3:return t.a(2)}},t,this,[[0,2]])})),function(t){return a.apply(this,arguments)}),updateAllCampaignsTable:(e=_asyncToGenerator(_regenerator().m(function t(e){var a;return _regenerator().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.sendAjaxRequest(this.prepareAjaxData("merchant_get_all_campaigns_table_data",e.startDate,e.endDate,"",""),".merchant-page-campaigns .merchant-analytics-loading-spinner");case 1:(a=t.v).success&&(this.updateAllCampaignsWithData(a.data,e.container),this.populateFilterSelect(e.container)),t.n=3;break;case 2:t.p=2,a=t.v,console.error("Error fetching cards data:",a);case 3:return t.a(2)}},t,this,[[0,2]])})),function(t){return e.apply(this,arguments)}),updateTopCampaignsWithData:function(t,e){var a=e.find("tbody");e.find("table th").removeClass("asc desc"),a.empty(),l.each(t,function(t,e){e="\n\t\t            <tr>\n\t\t                <td>".concat(e.campaign_info.module_name,": ").concat(e.campaign_info.campaign_title,"</td>\n\t\t                <td>").concat(e.impressions,"</td>\n\t\t                <td>").concat(e.clicks,'</td>\n\t\t                <td class="ctr">').concat(e.ctr,"</td>\n\t\t                <td>").concat(e.orders,"</td>\n\t\t                <td>").concat(e.revenue,"</td>\n\t\t            </tr>\n\t\t        ");l(a).append(e)})},updateAllCampaignsWithData:function(t,e){var o=[],a=e.find("tbody"),i=(a.empty(),e.find("table th").removeClass("asc desc"),e.find(".js-campaign-search").val(""),e.find(".no-results-message").hide(),0),e=e.find(".js-pagination"),s=parseInt(e.attr("data-rows-per-page"));l.each(t,function(a,n){var r=n.module_id;0<n.campaigns.length&&n.campaigns.forEach(function(t,e){i++;var e="".concat(r,"-campaign-").concat(a,"-").concat(e);o.push('\n\t\t\t\t            <tr\n\t\t\t\t            \tclass="'.concat(s<i?"is-hidden":"",'"\n\t\t\t\t            \t').concat(s<i?'style="display: none;"':"",'\n\t\t\t\t                data-module-id="').concat(r,'"\n\t\t\t\t                data-campaign-key="').concat(t.campaign_key,'"\n\t\t\t\t                data-campaign-id="').concat(t.campaign_id,'"\n\t\t\t\t                data-row-count="').concat(i,'">\n\t\t\t\t                <td><input type="checkbox" name="campaign_select[]" value="').concat(t.title,'" /></td>\n\t\t\t\t                <td class="merchant__campaign-name js-campaign-name">').concat(t.title,'</td>\n\t\t\t\t                <td class="merchant__module-name js-module-name" data-module-id="').concat(n.module_id,'">').concat(n.module_name,'</td>\n\t\t\t\t                <td class="merchant__status merchant-module-page-setting-field-switcher js-status">\n\t\t\t\t                    ').concat("active"===t.status||"inactive"===t.status?'<div class="merchant-toggle-switch">\n\t\t\t\t\t\t\t\t                <input type="checkbox" id="'.concat(e,'" name="merchant[').concat(e,']" value="').concat("active"===t.status?"1":"",'" ').concat("active"===t.status?"checked ":"",'class="toggle-switch-checkbox">\n\t\t\t\t\t\t\t\t                <label class="toggle-switch-label" for="').concat(e,'">\n\t\t\t\t\t\t\t\t                    <span class="toggle-switch-inner"></span>\n\t\t\t\t\t\t\t\t                    <span class="toggle-switch-switch"></span>\n\t\t\t\t\t\t\t\t                </label>\n\t\t\t\t\t\t\t\t\t\t\t</div>'):"-",'\n\t\t\t\t                </td>\n\t\t\t\t                <td class="merchant__impressions">').concat(t.impression,'</td>\n\t\t\t\t                <td class="merchant__clicks">').concat(t.clicks,'</td>\n\t\t\t\t                <td class="merchant__revenue">').concat(null!=(e=t.revenue)?e:"-",'</td>\n\t\t\t\t                <td class="merchant__ctr">').concat(t.ctr,'</td>\n\t\t\t\t                <td class="merchant__orders">').concat(t.orders,'</td>\n\t\t\t\t                <td class="merchant__edit">\n\t\t\t\t                    <a href="').concat(n.edit_url||"#",'" target="_blank">\n\t\t\t\t                        <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none">\n\t\t\t\t                            <path d="M8.30399 1.00174C8.90067 0.405063 9.8596 0.405063 10.4563 1.00174L10.7333 1.27876C11.33 1.87543 11.33 2.83437 10.7333 3.43104L6.51398 7.65037C6.3435 7.82085 6.10909 7.97001 5.85338 8.03394L3.7224 8.65192C3.55193 8.69454 3.36014 8.65192 3.23228 8.50276C3.08311 8.3749 3.04049 8.18311 3.08311 8.01263L3.70109 5.88166C3.76502 5.62594 3.91419 5.39154 4.08467 5.22106L8.30399 1.00174ZM9.73175 1.72627C9.53996 1.53448 9.22031 1.53448 9.02852 1.72627L8.38923 2.34425L9.39079 3.3458L10.0088 2.70651C10.2006 2.51473 10.2006 2.19508 10.0088 2.00329L9.73175 1.72627ZM4.68134 6.15869L4.31908 7.41596L5.57635 7.0537C5.66159 7.03239 5.72552 6.98977 5.78945 6.92584L8.66626 4.04903L7.68601 3.06878L4.8092 5.94559C4.74527 6.00952 4.70265 6.07345 4.68134 6.15869ZM4.61741 1.83281C4.89444 1.83281 5.12885 2.06722 5.12885 2.34425C5.12885 2.64258 4.89444 2.85568 4.61741 2.85568H2.23072C1.7406 2.85568 1.37834 3.23926 1.37834 3.70807V9.50431C1.37834 9.99444 1.7406 10.3567 2.23072 10.3567H8.02697C8.49578 10.3567 8.87936 9.99444 8.87936 9.50431V7.11763C8.87936 6.8406 9.09245 6.60619 9.39079 6.60619C9.66782 6.60619 9.90222 6.8406 9.90222 7.11763V9.50431C9.90222 10.5485 9.04983 11.3796 8.02697 11.3796H2.23072C1.18655 11.3796 0.355469 10.5485 0.355469 9.50431V3.70807C0.355469 2.6852 1.18655 1.83281 2.23072 1.83281H4.61741Z" fill="#565865"/>\n\t\t\t\t                        </svg>\n\t\t\t\t                        Edit\n\t\t\t\t                    </a>\n\t\t\t\t                </td>\n\t\t\t\t            </tr>\n\t\t\t\t        '))})}),l(a).append(o.join("")),this.updatePaginationButtons(1,parseInt(e.attr("data-total-pages-initial")),parseInt(e.attr("data-total-rows-initial")))},datePickerInit:function(t,e){var n=e.onSelectHandler,r=e.datePickerArgs,e=t.find(".date-range-input");e.length&&e.each(function(){var t=l(this),e=t.val(),a=[],e=(e&&(a=e.split(" - ").map(function(t){return new Date(t.trim())})),_objectSpread(_objectSpread({},{maxDate:new Date,locale:JSON.parse(merchant_datepicker_locale),range:!0,position:"bottom right",dateFormat:"MM/dd/yy",selectedDates:a,multipleDatesSeparator:" - ",onSelect:function(t){"function"==typeof n&&n(t)}}),r));new AirDatepicker(t.get(0),e)})},initOverviewCards:function(){var a=this,n=l(".merchant-analytics-overview-section");this.datePickerInit(n,{onSelectHandler:function(){var t=n.find(".first-date-range .date-range-input"),e=n.find(".second-date-range .date-range-input"),t=t.val().split(" - ").map(function(t){return t.trim()}),e=e.val().split(" - ").map(function(t){return t.trim()});2===t.length&&2===e.length&&a.updateOverviewCards({startDate:t[0],endDate:t[1],compareStartDate:e[0],compareEndDate:e[1]})}})},renderChart:function(t,e,a,n){var r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},o=t.find(".chart");if(o.length)return(e=new ApexCharts(o.get(0),e)).render(),e.updateSeries([{data:JSON.parse(o.attr("data-period"))}]),this.datePickerInit(t,{onSelectHandler:function(t){2===t.formattedDate.length&&a(t)},datePickerArgs:r}),e},widgetChartRender:function(){var e=this,t=l(".widget-chart-section"),a=l("body").hasClass("rtl");d.revenueChart=this.renderChart(t,this.widgetChartOptions,function(t){return e.updateRevenueChart(t)},".widget-chart-section .merchant-analytics-loading-spinner",{position:a?"top right":"top left"})},revenueChartRender:function(){var e=this,t=l(".revenue-chart-section");t.length&&(this.revenueChart=this.renderChart(t,this.revenueChartOptions,function(t){return e.updateRevenueChart(t)},".revenue-chart-section .merchant-analytics-loading-spinner"))},avgOrderValChartRender:function(){var e=this,t=l(".aov-chart-section");t.length&&(this.avgOrderValChart=this.renderChart(t,this.avgOrderValChartOptions,function(t){return e.updateAOVChart(t)},".aov-chart-section .merchant-analytics-loading-spinner"))},impressionsChartRender:function(){var e=this,t=l(".impressions-chart-section");t.length&&(this.impressionsChart=this.renderChart(t,this.columnChartOptions,function(t){return e.updateImpressionsChart(t)},".impressions-chart-section .merchant-analytics-loading-spinner"))},initTopCampaignsTable:function(){var e=l(".merchant-analytics-section.campaigns-table"),a=this;e.length&&(this.datePickerInit(e,{onSelectHandler:function(){var t=e.find(".first-date-range .date-range-input").val().split(" - ").map(function(t){return t.trim()});2===t.length&&a.updatePerformingCampaignsTable({startDate:t[0],endDate:t[1],container:e})},datePickerArgs:{position:"top right"}}),this.setupSortableTableEventListeners(e))},initAllCampaignsTable:function(){var e=l(".merchant-analytics-section.all-campaigns-table"),a=this;e.length&&(this.datePickerInit(e,{onSelectHandler:function(){var t=e.find(".first-date-range .date-range-input").val().split(" - ").map(function(t){return t.trim()});2===t.length&&a.updateAllCampaignsTable({startDate:t[0],endDate:t[1],container:e})}}),a.setupSortableTableEventListeners(e),a.populateFilterSelect(e))},populateFilterSelect:function(t){var t=t.find(".js-campaigns-table"),a=l(".filter-campaign select"),n=(l(a).find("option:not(:first)").remove(),[]);l(t).find("tr .js-module-name").each(function(){var e=l(this).attr("data-module-id"),t=l(this).text().trim();e&&!n.some(function(t){return t.value===e})&&n.push({value:e,label:t})}),n.sort(),l.each(n,function(t,e){l(a).append(l("<option>",{value:e.value,text:e.label}))})},setupSortableTableEventListeners:function(e){var r=this,o=(e.find("th:not(.no-sort)").on("click",function(t){r.sortableTable(l(t.currentTarget),e)}),l(".js-campaigns-table")),t=l(".js-campaign-search"),a=l(".js-filter-module"),n=l(".js-bulk-action"),i=l(".js-pagination");o.find('thead th:first-child input[type="checkbox"]').on("change",function(){var t=l(this).prop("checked");o.find('tbody tr:not(.is-hidden) input[type="checkbox"]:not(.toggle-switch-checkbox)').prop("checked",t)}),o.on("change",'.js-status input[type="checkbox"]',function(){var t=l(this),e=t.closest("tr"),e=_defineProperty({},e.attr("data-module-id"),{campaign_key:e.attr("data-campaign-key"),campaigns:[{campaign_id:e.attr("data-campaign-id"),status:t.prop("checked")?"active":"inactive"}]});r.updateCampaignStatus(e,t,[t],!0)}),n.on("click",function(t){t.preventDefault();var a,n=l(this).closest(".bulk-action").find("select").val();n?(t=o.find('tbody tr:not(.is-hidden) input[type="checkbox"]:not(.toggle-switch-checkbox):checked')).length?(a={},t.each(function(){var t=l(this).closest("tr"),e=t.attr("data-module-id");a[e]||(a[e]={campaign_key:t.attr("data-campaign-key"),campaigns:[]}),a[e].campaigns.push({campaign_id:t.attr("data-campaign-id"),status:n})}),r.updateCampaignStatus(a,l(this),t)):alert("Please select campaigns."):alert("Please select an action.")}),t.on("input",r.debounce(function(){r.filterTableTable(a.val(),o,l(this).val())},300)),a.on("change",function(){r.filterTableTable(l(this).val(),o,""),t.val("")}),i.on("click",".pagination-button",function(t){t.preventDefault();var t=parseInt(l(this).attr("data-current-page")),e=parseInt(l(this).attr("data-page"));isNaN(e)||e===t||(r.paginateRows(t=e,o.find("tbody tr")),r.updatePaginationButtons(t))})},sortableTable:function(t,e){var n=t.index(),r=t.data("sort"),o=t.hasClass("asc")?"desc":"asc",t=(e.find("th").removeClass("asc desc"),t.addClass(o),e.find("tbody")),e=t.find("tr").toArray();e.sort(function(t,e){var a,t=l(t).find("td").eq(n).text(),e=l(e).find("td").eq(n).text(),t="int"===r?(a=parseInt(t.replace(/[^0-9]/g,""),10),parseInt(e.replace(/[^0-9]/g,""),10)):"float"===r?(a=parseFloat(t.replace(/[^0-9.]/g,"")),parseFloat(e.replace(/[^0-9.]/g,""))):(a=t,e);return"asc"==o?a<t?-1:t<a?1:0:t<a?-1:a<t?1:0}),t.append(e)},filterTableTable:function(r,t){var o,e,a,n,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"";t.length&&(o=0,(e=t.find("tbody tr")).each(function(){var t=l(this),e=t.attr("data-module-id"),a=t.find(".js-campaign-name").text().toLowerCase(),n=t.find(".js-module-name").text().toLowerCase(),e=!r||e===r,a=!i||a.includes(i)||n.includes(i);e&&a?(t.show().removeClass("filtered-out is-hidden"),o++):t.hide().addClass("filtered-out")}),a=o,n=parseInt(t.closest(".merchant-page-campaigns").find(".js-pagination").attr("data-rows-per-page")),n=Math.max(1,Math.ceil(a/n)),this.paginateRows(1,e),this.updateNoResults(0===o,t),this.updatePaginationButtons(1,n,a))},paginateRows:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,e=1<arguments.length?arguments[1]:void 0,a=l(".js-pagination"),a=parseInt(a.attr("data-rows-per-page")),n=(t-1)*a,r=n+a;e.hide().addClass("is-hidden"),e.filter(":not(.filtered-out)").each(function(t){n<=t&&t<r&&l(this).show().removeClass("is-hidden")})},updateNoResults:function(t,e){var a=e.next(".no-results-message");t?(a.length||(a=l('<div class="no-results-message" style="">No matching campaigns found</div>'),e.after(a)),a.show()):a.length&&a.hide()},updatePaginationButtons:function(t,e,a){var n=l(".js-pagination"),r=(n.attr("data-current-page",t),e&&n.attr("data-total-pages",e),a&&n.attr("data-total-rows",a),e=parseInt(n.attr("data-total-pages")),"");if(1<t&&(r+='\n\t\t          <button class="pagination-button prev-page" data-page="'.concat(t-1,'">\n\t\t            <svg xmlns="http://www.w3.org/2000/svg" width="7" height="12" viewBox="0 0 7 12" fill="#565865">\n\t\t              <path d="M5.16797 11.3301L0.521484 6.48047C0.394531 6.32812 0.34375 6.17578 0.34375 6.02344C0.34375 5.89648 0.394531 5.74414 0.496094 5.61719L5.14258 0.767578C5.37109 0.513672 5.77734 0.513672 6.00586 0.742188C6.25977 0.970703 6.25977 1.35156 6.03125 1.60547L1.79102 6.02344L6.05664 10.4922C6.28516 10.7207 6.28516 11.127 6.03125 11.3555C5.80273 11.584 5.39648 11.584 5.16797 11.3301Z"/>\n\t\t            </svg>\n\t\t          </button>\n\t\t\t\t')),1<e)for(var o=1;o<=e;o++)r+='\n          \t\t\t<button class="pagination-button'.concat(o===t?" pagination-active":"",'" data-page="').concat(o,'">').concat(o,"</button>\n\t\t\t\t");t<e&&(r+='\n\t\t          <button class="pagination-button next-page" data-page="'.concat(t+1,'">\n\t\t            <svg xmlns="http://www.w3.org/2000/svg" width="7" height="12" viewBox="0 0 7 12" fill="#565865">\n\t\t              <path d="M1.80664 0.742188L6.45312 5.5918C6.55469 5.71875 6.63086 5.87109 6.63086 6.02344C6.63086 6.17578 6.55469 6.32812 6.45312 6.42969L1.80664 11.2793C1.57812 11.5332 1.17188 11.5332 0.943359 11.3047C0.689453 11.0762 0.689453 10.6953 0.917969 10.4414L5.18359 5.99805L0.917969 1.58008C0.689453 1.35156 0.689453 0.945312 0.943359 0.716797C1.17188 0.488281 1.57812 0.488281 1.80664 0.742188Z"/>\n\t\t            </svg>\n\t\t          </button>\n\t\t\t\t')),n.html(r);var i,s,c=l(".js-pagination-results");1<e?(i=parseInt(n.attr("data-total-rows")),n=(s=(t-1)*(n=parseInt(n.attr("data-rows-per-page"))))+n,c.find(".pagination-start-row").text(s||1),c.find(".pagination-end-row").text(i<n?i:n),c.find(".pagination-total-rows").text(a),c.show()):c.hide()},updateCampaignStatus:(n=_asyncToGenerator(_regenerator().m(function t(e,a,n){var r,o,i,s,c=arguments;return _regenerator().w(function(t){for(;;)switch(t.p=t.n){case 0:return r=3<c.length&&void 0!==c[3]&&c[3],o=this,i=a.closest(".all-campaigns-table").find(".js-campaigns-table"),s='<span class="spinner is-active"></span>',a.prop("disabled",!0),r?(a.closest(".merchant-toggle-switch").append(s),a.closest("tr").css("opacity",".7")):(i.css("opacity",".7"),a.closest(".bulk-action").append(s)),t.p=1,t.n=2,this.sendAjaxRequest({action:"merchant_update_campaign_status",nonce:o.NONCE,campaign_data:e},"","POST").then(function(t){t.success&&(r||null!=n&&n.each(function(){l(this).closest("tr").find('.js-status input[type="checkbox"]').prop("checked","active"===t.data.status)}),l(document).trigger("merchant_campaign_status_updated",[t.data,a,n,r,e])),l(".spinner").remove(),a.prop("disabled",!1),(r?a.closest("tr"):(null!=n&&n.each(function(){i.find('thead th:first-child input[type="checkbox"]').prop("checked",!1),l(this).prop("checked",!1)}),i)).css("opacity","")});case 2:t.n=4;break;case 3:t.p=3,s=t.v,console.error("Error fetching campaign status data:",s);case 4:return t.a(2)}},t,this,[[1,3]])})),function(t,e,a){return n.apply(this,arguments)}),debounce:function(r,o){var i;return function(){for(var t=this,e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];clearTimeout(i),i=setTimeout(function(){return r.apply(t,a)},o)}}};l(document).ready(function(){d.initOverviewCards(),d.widgetChartRender(),d.revenueChartRender(),d.avgOrderValChartRender(),d.impressionsChartRender(),d.initTopCampaignsTable(),d.initAllCampaignsTable()})})(jQuery);
  • merchant/trunk/assets/js/modules/pre-orders/pre-orders.js

    r3003440 r3338013  
    2525        }
    2626        $product.removeClass('merchant-pre-ordered-product');
    27         if (variation.is_pre_order == true) {
     27        if (variation.is_pre_order === true) {
    2828          if (variation.is_pre_order_date) {
    2929            $product.addClass('merchant-pre-ordered-product');
    30             $product.find('.woocommerce-variation-add-to-cart').before('<div class="merchant-pre-orders-date">' + variation.is_pre_order_date + '</div>');
     30            if (variation.pre_order_placement === 'before') {
     31              $product.find('.variations_form.cart').before('<div class="merchant-pre-orders-date">' + variation.is_pre_order_date + '</div>');
     32            } else if (variation.pre_order_placement === 'after') {
     33              $product.find('.variations_form.cart').after('<div class="merchant-pre-orders-date">' + variation.is_pre_order_date + '</div>');
     34            }
    3135          }
    3236          $button.html(window.merchant.setting.pre_orders_add_button_title);
  • merchant/trunk/assets/js/modules/pre-orders/pre-orders.min.js

    r3198417 r3338013  
    1 var merchant=merchant||{};merchant.modules=merchant.modules||{},(a=>{merchant.modules.preOrders={init:function(){var d;a(document).on("show_variation",".variations_form",function(r,e){var t=a(this).closest(".product"),o=t.find(".single_add_to_cart_button:not(.merchant_buy_now_button)"),n=(t.find(".variations_form"),t.find(".merchant-pre-orders-date"));d=d||o.html(),n.length&&n.remove(),t.removeClass("merchant-pre-ordered-product"),1==e.is_pre_order?(e.is_pre_order_date&&(t.addClass("merchant-pre-ordered-product"),t.find(".woocommerce-variation-add-to-cart").before('<div class="merchant-pre-orders-date">'+e.is_pre_order_date+"</div>")),o.html(window.merchant.setting.pre_orders_add_button_title)):o.html(d)}),a(document).on("click.wc-variation-form",".reset_variations",function(){var r=a(this).closest(".product"),e=r.find(".merchant-pre-orders-date");e.length&&e.remove(),r.removeClass("merchant-pre-ordered-product"),r.find(".single_add_to_cart_button:not(.merchant_buy_now_button)").html(d)})}},merchant.modules.preOrders.init()})(jQuery);
     1var merchant=merchant||{};merchant.modules=merchant.modules||{},(d=>{merchant.modules.preOrders={init:function(){var a;d(document).on("show_variation",".variations_form",function(r,e){var t=d(this).closest(".product"),o=t.find(".single_add_to_cart_button:not(.merchant_buy_now_button)"),n=(t.find(".variations_form"),t.find(".merchant-pre-orders-date"));a=a||o.html(),n.length&&n.remove(),t.removeClass("merchant-pre-ordered-product"),!0===e.is_pre_order?(e.is_pre_order_date&&(t.addClass("merchant-pre-ordered-product"),"before"===e.pre_order_placement?t.find(".variations_form.cart").before('<div class="merchant-pre-orders-date">'+e.is_pre_order_date+"</div>"):"after"===e.pre_order_placement&&t.find(".variations_form.cart").after('<div class="merchant-pre-orders-date">'+e.is_pre_order_date+"</div>")),o.html(window.merchant.setting.pre_orders_add_button_title)):o.html(a)}),d(document).on("click.wc-variation-form",".reset_variations",function(){var r=d(this).closest(".product"),e=r.find(".merchant-pre-orders-date");e.length&&e.remove(),r.removeClass("merchant-pre-ordered-product"),r.find(".single_add_to_cart_button:not(.merchant_buy_now_button)").html(a)})}},merchant.modules.preOrders.init()})(jQuery);
  • merchant/trunk/inc/class-merchant-loader.php

    r3320812 r3338013  
    218218        public function settings_link( $links ) {
    219219            if ( ! merchant_pro_is_active() || ! merchant_pro_license_exists() ) {
     220                $url = merchant_admin_upgrade_link(
     221                    'https://athemes.com/merchant/#pricing',
     222                    array(),
     223                    'plugins-page-upgrade-link'
     224                );
    220225                $links['merchant-pro'] = sprintf(
    221226                    '<a href="%1$s" aria-label="%2$s" target="_blank" rel="noopener noreferrer"
     
    224229                onmouseout="this.style.color=\'#00a32a\';"
    225230                >%3$s</a>',
    226                     esc_url(
    227                         merchant_admin_upgrade_link(
    228                             'all-plugins',
    229                             'Get Merchant Pro'
    230                         )
    231                     ),
     231                    esc_url( $url ),
    232232                    esc_attr__( 'Upgrade to Merchant Pro', 'merchant' ),
    233233                    esc_html__( 'Get Merchant Pro', 'merchant' )
  • merchant/trunk/inc/classes/class-merchant-metabox.php

    r3079548 r3338013  
    333333                        echo '<div class="merchant-metabox-field-content">';
    334334
    335                         $meta    = get_post_meta( $post->ID, $field_id );
     335                        $meta    = get_post_meta( $post->ID, $field_id, false );
    336336                        $default = ( isset( $field['default'] ) ) ? $field['default'] : null;
    337337                        $value   = ( isset( $meta[0] ) ) ? $meta[0] : $default;
  • merchant/trunk/inc/functions.php

    r3293700 r3338013  
    267267     * Get the Merchant Pro upgrade link.
    268268     *
    269      * @param string $medium  The medium type (link, button, etc.).
    270      * @param string $content The content to display.
     269     * @param string $url  The base URL for the upgrade link.
     270     * @param array  $args The arguments for the upgrade link. (Key-value pairs)
     271     * @param string $type The type of upgrade link.
    271272     *
    272273     * @return string The upgrade link.
    273274     */
    274     function merchant_admin_upgrade_link( $medium = 'link', $content = '' ) {
    275         $url = 'https://athemes.com/merchant/#pricing';
     275    function merchant_admin_upgrade_link( $url, $args = array(), $type = 'plugins-page-upgrade-link' ) {
     276        if ( ! empty( $args ) ) {
     277            $url = add_query_arg( $args, $url );
     278        }
    276279
    277280        /**
    278281         * Modify upgrade link.
    279282         *
    280          * @param string $upgrade Upgrade links.
    281          *
    282          * @since 2.1.2
     283         * @param string $url  The upgrade link URL.
     284         * @param string $type The type of upgrade link.
     285         *
     286         * @since 2.1.5
    283287         *
    284288         */
    285         return apply_filters( 'merchant_upgrade_link', $url );
     289        return apply_filters( 'merchant_upgrade_link', $url, $type );
    286290    }
    287291}
     
    305309     */
    306310    function merchant_pro_license_exists() {
    307         return ! empty( get_option( 'merchant_license_key' ) );
     311        return ! empty( get_option( 'merchant_pro_license_key' ) );
    308312    }
    309313}
  • merchant/trunk/inc/modules/add-to-cart-text/class-add-to-cart-text.php

    r3232601 r3338013  
    8484
    8585        // Customize add to cart text on the single product page.
    86         add_filter( 'woocommerce_product_single_add_to_cart_text', array( $this, 'customize_single_add_to_cart_text' ), 99 );
     86        add_filter( 'woocommerce_product_single_add_to_cart_text', array( $this, 'customize_single_add_to_cart_text' ), 99, 2 );
    8787
    8888        // Customize add to cart text on shop pages.
     
    202202     * Customize add to cart text the single product page.
    203203     *
    204      * @param string $default_val
     204     * @param string     $default_val The "add to cart" button default label
     205     * @param WC_Product $product     The product object.
    205206     *
    206207     * @return string
    207208     */
    208     public function customize_single_add_to_cart_text( $default_val ) {
    209         global $product;
     209    public function customize_single_add_to_cart_text( $default_val, $product ) {
     210        if( ! $product instanceof WC_Product ) {
     211            return $default_val; // Return default value if product is not an instance of WC_Product. (Stay safe)
     212        }
    210213
    211214        /**
  • merchant/trunk/inc/modules/pre-orders/class-pre-orders-main-functionality.php

    r3321967 r3338013  
    6262        add_filter( 'woocommerce_product_add_to_cart_text', array( $this, 'change_button_text' ), 10, 2 );
    6363        add_filter( 'woocommerce_product_single_add_to_cart_text', array( $this, 'change_button_text' ), 10, 2 );
    64         add_filter( 'woocommerce_available_variation', array( $this, 'change_button_text_for_variable_products' ), 10, 3 );
     64        add_filter( 'woocommerce_available_variation', array( $this, 'attach_pre_order_data_to_variations' ), 10, 3 );
    6565        add_action( 'woocommerce_before_add_to_cart_form', array( $this, 'additional_information_before_cart_form' ) );
    6666        add_action( 'woocommerce_after_add_to_cart_form', array( $this, 'additional_information_after_cart_form' ) );
     
    938938     * Change pre-order button text for variable products.
    939939     *
    940      * @param array  $data
    941      * @param object $product
    942      * @param object $variation
     940     * @param array                $data      variation data.
     941     * @param WC_Product           $product   The product object.
     942     * @param WC_Product_Variation $variation The variation object.
    943943     *
    944944     * @return array
    945945     */
    946     public function change_button_text_for_variable_products( $data, $product, $variation ) {
    947         if ( $this->is_pre_order( $variation->get_id() ) ) {
    948             $pre_order_rule = self::available_product_rule( $variation->get_id() );
    949             $data['is_pre_order'] = true;
     946    public function attach_pre_order_data_to_variations( $data, $product, $variation ) {
     947        $pre_order_rule = self::available_product_rule( $variation->get_id() );
     948        if ( empty( $pre_order_rule ) ) {
     949            $pre_order_rule = self::available_product_rule( $product->get_id() );
     950        }
     951        if ( ! empty( $pre_order_rule ) ) {
     952            $data['is_pre_order']        = true;
     953            $data['pre_order_placement'] = isset( $pre_order_rule['placement'] ) ? $pre_order_rule['placement'] : 'before';
    950954
    951955            $additional_text = $pre_order_rule['additional_text'] ? Merchant_Translator::translate( $pre_order_rule['additional_text'] )
  • merchant/trunk/inc/modules/product-labels/class-product-labels.php

    r3232601 r3338013  
    468468        if ( 'Kadence' === $theme_name ) {
    469469            $css .= '
    470                 .merchant-product-labels-image-wrap img,
    471470                .merchant_product-labels-grid_item_html a,
    472471                .merchant_product-labels-grid_item_html .wc-block-grid__product-image,
  • merchant/trunk/languages/merchant.pot

    r3321967 r3338013  
    99"Language-Team: aThemes <[email protected]>\n"
    1010"Last-Translator: aThemes <[email protected]>\n"
    11 "POT-Creation-Date: 2025-07-03 17:57+0000\n"
     11"POT-Creation-Date: 2025-08-01 20:32+0000\n"
    1212"Report-Msgid-Bugs-To: https://athemes.com/contact/\n"
    1313"X-Poedit-Basepath: ..\n"
     
    1818"Plural-Forms: nplurals=2; plural=(n != 1);\n"
    1919
    20 #: admin/class-merchant-admin-loader.php:144, inc/class-merchant-loader.php:249, admin/classes/class-merchant-admin-menu.php:281, admin/classes/class-merchant-admin-menu.php:282, admin/classes/class-merchant-admin-menu.php:363, admin/classes/class-merchant-admin-menu.php:366, inc/modules/address-autocomplete/admin/options.php:27, inc/modules/agree-to-terms-checkbox/admin/options.php:28, inc/modules/auto-external-links/admin/options.php:16, inc/modules/buy-now/admin/options.php:14, inc/modules/cart-count-favicon/admin/options.php:16, inc/modules/cart-reserved-timer/admin/options.php:30, inc/modules/checkout/admin/options.php:27, inc/modules/clear-cart/admin/options.php:16, inc/modules/cookie-banner/admin/options.php:14, inc/modules/countdown-timer/admin/options.php:14, inc/modules/inactive-tab-message/admin/options.php:16, inc/modules/login-popup/admin/options.php:15, inc/modules/payment-logos/admin/options.php:33, inc/modules/product-audio/admin/options.php:15, inc/modules/product-brand-image/admin/options.php:15, inc/modules/product-labels/admin/options.php:47, inc/modules/product-navigation-links/admin/options.php:16, inc/modules/product-swatches/admin/options.php:17, inc/modules/product-video/admin/options.php:15, inc/modules/quick-social-links/admin/options.php:16, inc/modules/quick-view/admin/options.php:17, inc/modules/real-time-search/admin/options.php:14, inc/modules/reasons-to-buy/admin/options.php:14, inc/modules/recently-viewed-products/admin/options.php:15, inc/modules/size-chart/admin/options.php:15, inc/modules/spending-goal/admin/options.php:15, inc/modules/sticky-add-to-cart/admin/options.php:15, inc/modules/stock-scarcity/admin/options.php:16, inc/modules/trust-badges/admin/options.php:45
     20#: admin/class-merchant-admin-loader.php:144, inc/class-merchant-loader.php:249, admin/classes/class-merchant-admin-menu.php:281, admin/classes/class-merchant-admin-menu.php:282, admin/classes/class-merchant-admin-menu.php:372, admin/classes/class-merchant-admin-menu.php:375, inc/modules/address-autocomplete/admin/options.php:27, inc/modules/agree-to-terms-checkbox/admin/options.php:28, inc/modules/auto-external-links/admin/options.php:16, inc/modules/buy-now/admin/options.php:14, inc/modules/cart-count-favicon/admin/options.php:16, inc/modules/cart-reserved-timer/admin/options.php:30, inc/modules/checkout/admin/options.php:27, inc/modules/clear-cart/admin/options.php:16, inc/modules/cookie-banner/admin/options.php:14, inc/modules/countdown-timer/admin/options.php:14, inc/modules/inactive-tab-message/admin/options.php:16, inc/modules/login-popup/admin/options.php:15, inc/modules/payment-logos/admin/options.php:33, inc/modules/product-audio/admin/options.php:15, inc/modules/product-brand-image/admin/options.php:15, inc/modules/product-labels/admin/options.php:47, inc/modules/product-navigation-links/admin/options.php:16, inc/modules/product-swatches/admin/options.php:17, inc/modules/product-video/admin/options.php:15, inc/modules/quick-social-links/admin/options.php:16, inc/modules/quick-view/admin/options.php:17, inc/modules/real-time-search/admin/options.php:14, inc/modules/reasons-to-buy/admin/options.php:14, inc/modules/recently-viewed-products/admin/options.php:15, inc/modules/size-chart/admin/options.php:15, inc/modules/spending-goal/admin/options.php:15, inc/modules/sticky-add-to-cart/admin/options.php:15, inc/modules/stock-scarcity/admin/options.php:16, inc/modules/trust-badges/admin/options.php:45
    2121msgid "Settings"
    2222msgstr ""
     
    310310msgstr ""
    311311
    312 #: admin/classes/class-merchant-admin-menu.php:235, admin/classes/class-merchant-admin-menu.php:236, admin/classes/class-merchant-admin-menu.php:340, admin/classes/class-merchant-admin-menu.php:343
     312#: admin/classes/class-merchant-admin-menu.php:235, admin/classes/class-merchant-admin-menu.php:236, admin/classes/class-merchant-admin-menu.php:349, admin/classes/class-merchant-admin-menu.php:352
    313313msgid "Dashboard"
    314314msgstr ""
    315315
    316 #: admin/classes/class-merchant-admin-menu.php:246, admin/classes/class-merchant-admin-menu.php:247, admin/classes/class-merchant-admin-menu.php:351, admin/classes/class-merchant-admin-menu.php:354, admin/pages/page-analytics.php:132
     316#: admin/classes/class-merchant-admin-menu.php:246, admin/classes/class-merchant-admin-menu.php:247, admin/classes/class-merchant-admin-menu.php:360, admin/classes/class-merchant-admin-menu.php:363, admin/pages/page-analytics.php:132
    317317msgid "Modules"
    318318msgstr ""
    319319
    320 #: admin/classes/class-merchant-admin-menu.php:258, admin/classes/class-merchant-admin-menu.php:259, admin/classes/class-merchant-admin-menu.php:374, admin/classes/class-merchant-admin-menu.php:377
     320#: admin/classes/class-merchant-admin-menu.php:258, admin/classes/class-merchant-admin-menu.php:259, admin/classes/class-merchant-admin-menu.php:383, admin/classes/class-merchant-admin-menu.php:386
    321321msgid "Campaigns"
    322322msgstr ""
    323323
    324 #: admin/classes/class-merchant-admin-menu.php:269, admin/classes/class-merchant-admin-menu.php:270, admin/classes/class-merchant-admin-menu.php:386, admin/classes/class-merchant-admin-menu.php:389
     324#: admin/classes/class-merchant-admin-menu.php:269, admin/classes/class-merchant-admin-menu.php:270, admin/classes/class-merchant-admin-menu.php:395, admin/classes/class-merchant-admin-menu.php:398
    325325msgid "Analytics"
    326326msgstr ""
     
    330330msgstr ""
    331331
    332 #: admin/classes/class-merchant-admin-menu.php:305, admin/classes/class-merchant-admin-menu.php:306, admin/classes/class-merchant-admin-menu.php:398, admin/classes/class-merchant-admin-menu.php:401
     332#: admin/classes/class-merchant-admin-menu.php:314, admin/classes/class-merchant-admin-menu.php:315, admin/classes/class-merchant-admin-menu.php:416, admin/classes/class-merchant-admin-menu.php:419
    333333msgid "Upgrade to Pro"
    334334msgstr ""
    335335
    336 #: admin/classes/class-merchant-admin-menu.php:329, admin/components/enabled-modules.php:76, admin/pages/page-dashboard.php:92, admin/pages/page-modules.php:62
     336#: admin/classes/class-merchant-admin-menu.php:338, admin/components/enabled-modules.php:76, admin/pages/page-dashboard.php:92, admin/pages/page-modules.php:62
    337337msgid "Merchant"
    338338msgstr ""
    339339
    340 #: admin/classes/class-merchant-admin-menu.php:332
     340#: admin/classes/class-merchant-admin-menu.php:341
    341341msgid "Merchant Dashboard"
    342342msgstr ""
     
    10671067msgstr ""
    10681068
    1069 #: admin/notices/class-merchant-notice-upsell.php:49
     1069#: admin/notices/class-merchant-notice-upsell.php:60
    10701070msgid "Supercharge Your Store with Merchant Pro! 🚀"
    10711071msgstr ""
    10721072
    1073 #: admin/notices/class-merchant-notice-upsell.php:53
     1073#: admin/notices/class-merchant-notice-upsell.php:64
    10741074msgid "With Merchant Pro's 40+ powerful modules — including Product Bundles, Frequently Bought Together, and Bulk Discounts — you can boost sales, enhance customer experience, and minimize cart abandonment, all from one convenient plugin."
    10751075msgstr ""
    10761076
    1077 #: admin/notices/class-merchant-notice-upsell.php:57
     1077#: admin/notices/class-merchant-notice-upsell.php:68
    10781078msgid "Upgrade To Merchant Pro"
    10791079msgstr ""
     
    11231123msgstr ""
    11241124
    1125 #: admin/pages/page-campaigns.php:47, admin/pages/page-module.php:91, inc/modules/wishlist/admin/options.php:417
     1125#: admin/pages/page-campaigns.php:47, admin/pages/page-module.php:102, inc/modules/wishlist/admin/options.php:417
    11261126msgid "Enable"
    11271127msgstr ""
    11281128
    1129 #: admin/pages/page-campaigns.php:48, admin/pages/page-module.php:105
     1129#: admin/pages/page-campaigns.php:48, admin/pages/page-module.php:116
    11301130msgid "Disable"
    11311131msgstr ""
     
    12911291msgstr ""
    12921292
    1293 #: admin/pages/page-module.php:96
     1293#: admin/pages/page-module.php:107
    12941294msgid "Enabled"
    12951295msgstr ""
    12961296
    1297 #: admin/pages/page-module.php:74
     1297#: admin/pages/page-module.php:85
    12981298msgid "Buy Pro"
    12991299msgstr ""
    13001300
    1301 #: admin/pages/page-module.php:115
     1301#: admin/pages/page-module.php:126
    13021302msgid "Did something go wrong?"
    13031303msgstr ""
    13041304
    1305 #: admin/pages/page-module.php:119
     1305#: admin/pages/page-module.php:130
    13061306msgid "Submit a bug: the module doesn’t work as expected"
    13071307msgstr ""
    13081308
    1309 #: admin/pages/page-module.php:122
     1309#: admin/pages/page-module.php:133
    13101310msgid "Some options are missing"
    13111311msgstr ""
    13121312
    1313 #: admin/pages/page-module.php:125
     1313#: admin/pages/page-module.php:136
    13141314msgid "It conflicts with another feature"
    13151315msgstr ""
    13161316
    1317 #: admin/pages/page-module.php:128
     1317#: admin/pages/page-module.php:139
    13181318msgid "I don’t need it anymore."
    13191319msgstr ""
    13201320
    1321 #: admin/pages/page-module.php:131, inc/modules/quick-social-links/admin/options.php:234, inc/modules/quick-social-links/admin/options.php:309
     1321#: admin/pages/page-module.php:142, inc/modules/quick-social-links/admin/options.php:234, inc/modules/quick-social-links/admin/options.php:309
    13221322msgid "Other"
    13231323msgstr ""
    13241324
    1325 #: admin/pages/page-module.php:141
     1325#: admin/pages/page-module.php:152
    13261326msgid "Please tell us why, and we’ll look into it."
    13271327msgstr ""
    13281328
    1329 #: admin/pages/page-module.php:146
     1329#: admin/pages/page-module.php:157
    13301330msgid "What feature are you looking for?"
    13311331msgstr ""
    13321332
    1333 #: admin/pages/page-module.php:150
     1333#: admin/pages/page-module.php:161
    13341334msgid "Please tell us what plugin/theme it conflicts with."
    13351335msgstr ""
    13361336
    1337 #: admin/pages/page-module.php:155
     1337#: admin/pages/page-module.php:166
    13381338msgid "Would you mind telling us why?"
    13391339msgstr ""
    13401340
    1341 #: admin/pages/page-module.php:162, templates/modules/advanced-reviews/modal.php:43
     1341#: admin/pages/page-module.php:173, templates/modules/advanced-reviews/modal.php:43
    13421342msgid "Submit"
    13431343msgstr ""
    13441344
    1345 #: admin/pages/page-module.php:170
     1345#: admin/pages/page-module.php:181
    13461346msgid "Thank you"
    13471347msgstr ""
    13481348
    1349 #: admin/pages/page-module.php:174
     1349#: admin/pages/page-module.php:185
    13501350msgid "Your feedback helps us improve Merchant."
    13511351msgstr ""
    13521352
    1353 #: admin/pages/page-module.php:185
     1353#: admin/pages/page-module.php:196
    13541354msgid "Tutorial"
    13551355msgstr ""
    13561356
    1357 #: admin/pages/page-module.php:237
     1357#: admin/pages/page-module.php:248
    13581358msgid "Backup & Restore"
    13591359msgstr ""
    13601360
    1361 #: admin/pages/page-module.php:241
     1361#: admin/pages/page-module.php:252
    13621362msgid "Backup Module Settings"
    13631363msgstr ""
    13641364
    1365 #: admin/pages/page-module.php:242
     1365#: admin/pages/page-module.php:253
    13661366msgid "Download a backup of your currently saved module settings as a JSON file. To capture the most up-to-date configuration, remember to save your settings before downloading the backup. You can then use this file to restore your settings later."
    13671367msgstr ""
    13681368
    1369 #: admin/pages/page-module.php:244
     1369#: admin/pages/page-module.php:255
    13701370msgid "Download"
    13711371msgstr ""
    13721372
    1373 #: admin/pages/page-module.php:249
     1373#: admin/pages/page-module.php:260
    13741374msgid "Restore Module Settings"
    13751375msgstr ""
    13761376
    1377 #: admin/pages/page-module.php:250
     1377#: admin/pages/page-module.php:261
    13781378msgid "Restore the module settings by uploading a previously saved backup file. Please be aware that restoring settings will overwrite your current module configurations."
    13791379msgstr ""
    13801380
    1381 #: admin/pages/page-module.php:252
     1381#: admin/pages/page-module.php:263
    13821382msgid "Upload Backup File"
    13831383msgstr ""
    13841384
    1385 #: admin/pages/page-module.php:256
     1385#: admin/pages/page-module.php:267
    13861386msgid "Restore"
    13871387msgstr ""
    13881388
    1389 #: admin/pages/page-module.php:269, admin/pages/page-settings.php:102
     1389#: admin/pages/page-module.php:280, admin/pages/page-settings.php:102
    13901390msgid "Preview"
    13911391msgstr ""
    13921392
    1393 #: admin/pages/page-module.php:297
     1393#: admin/pages/page-module.php:308
    13941394msgid "Important info!"
    13951395msgstr ""
    13961396
    1397 #: admin/pages/page-module.php:301
     1397#: admin/pages/page-module.php:312
    13981398msgid "This module is currently disabled. Please enable the module to see it in your store."
    13991399msgstr ""
     
    21902190msgstr ""
    21912191
    2192 #: inc/modules/pre-orders/class-pre-orders-main-functionality.php:931, inc/modules/pre-orders/class-pre-orders-main-functionality.php:1635, inc/modules/pre-orders/class-pre-orders.php:65, inc/modules/pre-orders/class-pre-orders.php:247
     2192#: inc/modules/pre-orders/class-pre-orders-main-functionality.php:931, inc/modules/pre-orders/class-pre-orders-main-functionality.php:1639, inc/modules/pre-orders/class-pre-orders.php:65, inc/modules/pre-orders/class-pre-orders.php:247
    21932193msgid "Pre Order Now!"
    21942194msgstr ""
    21952195
    2196 #: inc/modules/pre-orders/class-pre-orders-main-functionality.php:952, inc/modules/pre-orders/class-pre-orders-main-functionality.php:1071, inc/modules/pre-orders/class-pre-orders-main-functionality.php:1636, inc/modules/pre-orders/class-pre-orders.php:66
     2196#: inc/modules/pre-orders/class-pre-orders-main-functionality.php:956, inc/modules/pre-orders/class-pre-orders-main-functionality.php:1075, inc/modules/pre-orders/class-pre-orders-main-functionality.php:1640, inc/modules/pre-orders/class-pre-orders.php:66
    21972197msgid "Ships on {date}."
    21982198msgstr ""
    21992199
    2200 #: inc/modules/pre-orders/class-pre-orders-main-functionality.php:1086
     2200#: inc/modules/pre-orders/class-pre-orders-main-functionality.php:1090
    22012201msgid "Pre Ordered"
    22022202msgstr ""
    22032203
    22042204#. translators: %s: pre ordered product count
    2205 #: inc/modules/pre-orders/class-pre-orders-main-functionality.php:1092
     2205#: inc/modules/pre-orders/class-pre-orders-main-functionality.php:1096
    22062206msgid "Pre Ordered <span class=\"count\">(%s)</span>"
    22072207msgid_plural "Pre Ordered <span class=\"count\">(%s)</span>"
     
    22092209msgstr[1] ""
    22102210
    2211 #: inc/modules/pre-orders/class-pre-orders-main-functionality.php:1104
     2211#: inc/modules/pre-orders/class-pre-orders-main-functionality.php:1108
    22122212msgid "Pre-Ordered"
    22132213msgstr ""
    22142214
    2215 #: inc/modules/pre-orders/class-pre-orders-main-functionality.php:1147, inc/modules/pre-orders/class-pre-orders-main-functionality.php:1337, inc/modules/pre-orders/class-pre-orders-main-functionality.php:1638, inc/modules/pre-orders/admin/options.php:398
     2215#: inc/modules/pre-orders/class-pre-orders-main-functionality.php:1151, inc/modules/pre-orders/class-pre-orders-main-functionality.php:1341, inc/modules/pre-orders/class-pre-orders-main-functionality.php:1642, inc/modules/pre-orders/admin/options.php:398
    22162216msgid "Ships on"
    22172217msgstr ""
    22182218
    2219 #: inc/modules/pre-orders/class-pre-orders-main-functionality.php:1629, inc/modules/pre-orders/admin/options.php:52
     2219#: inc/modules/pre-orders/class-pre-orders-main-functionality.php:1633, inc/modules/pre-orders/admin/options.php:52
    22202220msgid "Custom Pre-order"
    22212221msgstr ""
     
    22692269msgstr ""
    22702270
    2271 #: inc/modules/product-labels/class-product-labels.php:771
     2271#: inc/modules/product-labels/class-product-labels.php:770
    22722272msgid "In stock"
    22732273msgstr ""
    22742274
    2275 #: inc/modules/product-labels/class-product-labels.php:771
     2275#: inc/modules/product-labels/class-product-labels.php:770
    22762276msgid "Sold out"
    22772277msgstr ""
  • merchant/trunk/merchant.php

    r3321967 r3338013  
    44 * Plugin URI:  https://athemes.com/merchant
    55 * Description: All-in-one WooCommerce plugin for pre-orders, product labels, buy now, quick view, discount rules and more.
    6  * Version:     2.1.4
     6 * Version:     2.1.5
    77 * Author:      aThemes
    88 * Author URI:  https://athemes.com
     
    1313 *
    1414 * WC requires at least: 6.0
    15  * WC tested up to: 9.6.0
     15 * WC tested up to: 10.0.0
    1616 *
    1717 * @package Merchant
     
    2525
    2626// Merchant constants.
    27 define( 'MERCHANT_VERSION', '2.1.4' );
     27define( 'MERCHANT_VERSION', '2.1.5' );
    2828define( 'MERCHANT_DB_VERSION', '1.1.0' ); // Update only when the database structure changes. In inc/classes/class-merchant-db-tables.php
    2929define( 'MERCHANT_FILE', __FILE__ );
  • merchant/trunk/readme.txt

    r3321967 r3338013  
    22Tags: pre-orders, buy now button, product labels, quick view, clear cart
    33Requires at least: 5.5
    4 Tested up to: 6.7
     4Tested up to: 6.8
    55Requires PHP: 7.3
    6 Stable tag: 2.1.4
     6Stable tag: 2.1.5
    77Contributors: aThemes
    88License: GPLv3 or later
     
    219219
    220220== Changelog ==
     221= 2.1.5 =
     222* Added - Wrapper function for UTM links
     223* Fixed - Product Labels: Fixed distorted product image aspect ratio when used with the Kadence theme
     224* Fixed - Pre-Orders: Product variations are now correctly recognized as pre-orders
     225* Fixed - Add to Cart Text: Fixed fatal error when enabling the module
     226
    221227= 2.1.4 =
    222 * Fixed - Combatibility between woo multi currency and pre orders module
     228* Fixed - Compatibility between woo multi currency and pre orders module
    223229
    224230= 2.1.3 =
Note: See TracChangeset for help on using the changeset viewer.