You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
7.9 KiB
JavaScript
1 line
7.9 KiB
JavaScript
!function(){var e={705:function(e,t,r){var n=r(639).Symbol;e.exports=n},239:function(e,t,r){var n=r(705),i=r(607),o=r(333),c=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":c&&c in Object(e)?i(e):o(e)}},561:function(e,t,r){var n=r(990),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},957:function(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},607:function(e,t,r){var n=r(705),i=Object.prototype,o=i.hasOwnProperty,c=i.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var i=c.call(e);return n&&(t?e[a]=r:delete e[a]),i}},333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:function(e,t,r){var n=r(957),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},990:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:function(e,t,r){var n=r(218),i=r(771),o=r(841),c=Math.max,a=Math.min;e.exports=function(e,t,r){var u,f,s,l,p,m,v=0,y=!1,d=!1,b=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=u,n=f;return u=f=void 0,v=t,l=e.apply(n,r)}function g(e){var r=e-m;return void 0===m||r>=t||r<0||d&&e-v>=s}function _(){var e=i();if(g(e))return x(e);p=setTimeout(_,function(e){var r=t-(e-m);return d?a(r,s-(e-v)):r}(e))}function x(e){return p=void 0,b&&u?h(e):(u=f=void 0,l)}function w(){var e=i(),r=g(e);if(u=arguments,f=this,m=e,r){if(void 0===p)return function(e){return v=e,p=setTimeout(_,t),y?h(e):l}(m);if(d)return clearTimeout(p),p=setTimeout(_,t),h(m)}return void 0===p&&(p=setTimeout(_,t)),l}return t=o(t)||0,n(r)&&(y=!!r.leading,s=(d="maxWait"in r)?c(o(r.maxWait)||0,t):s,b="trailing"in r?!!r.trailing:b),w.cancel=function(){void 0!==p&&clearTimeout(p),v=0,u=m=f=p=void 0},w.flush=function(){return void 0===p?l:x(i())},w}},218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},448:function(e,t,r){var n=r(239),i=r(5);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},771:function(e,t,r){var n=r(639);e.exports=function(){return n.Date.now()}},841:function(e,t,r){var n=r(561),i=r(218),o=r(448),c=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,f=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=a.test(e);return r||u.test(e)?f(e.slice(2),r?2:8):c.test(e)?NaN:+e}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=jQuery,t=r.n(e),n=r(279),i=r.n(n),o=wp.hooks;function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function u(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c(t)?t:String(t)}var f=new(function(){function e(){var t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,n=null,(r=u(r="map"))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n}var r,n,i;return r=e,(n=[{key:"swap",value:function(e,t){var r=this;if(!(e=e||""))return"";var n=new RegExp(/%(([a-z0-9_-]+)\(([^)]*)\)|[^\s]+)%/,"giu");return e.replace(" %page%","").replace("%sep% %sep%","%sep%").replace(n,(function(e){return r.replace(t,e)})).trim()}},{key:"replace",value:function(e,r){var n=r.toLowerCase().slice(1,-1);return["term_description","user_description"].includes(n)?"undefined"!=typeof tinymce&&tinymce.activeEditor&&"rank_math_description_editor"===tinymce.activeEditor.id?tinymce.activeEditor.getContent():t()("#description").val():n.includes("customfield(")?(n=n.replace("customfield(","").replace(")",""))in rankMath.customFields?rankMath.customFields[n]:"":(e=e||this.getMap(),(n="seo_description"===(n="seo_title"===(n=n.includes("(")?n.split("(")[0]:n)?"title":n)?"excerpt":n)in e?e[n]:"")}},{key:"getMap",value:function(){var e=this;return null!==this.map||(this.map={},t().each(rankMath.variables,(function(t,r){t=t.toLowerCase().replace(/%+/g,"").split("(")[0],e.map[t]=r.example}))),this.map}},{key:"setVariable",value:function(e,t){null!==this.map?this.map[e]=t:void 0!==rankMath.variables[e]&&(rankMath.variables[e].example=t)}}])&&a(r.prototype,n),i&&a(r,i),Object.defineProperty(r,"prototype",{writable:!1}),e}());function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===s(o)?o:String(o)),n)}var i,o}var p=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.excerpt=t()("#excerpt"),this.elemPrice=t()("#_sale_price"),this.elemRegPrice=t()("#_regular_price"),this.refreshWCPrice=this.refreshWCPrice.bind(this),this.events(),this.hooks()}var r,n,c;return r=e,(n=[{key:"hooks",value:function(){void 0!==this.excerpt&&(0,o.addFilter)("rank_math_content","rank-math",this.getContent.bind(this),11)}},{key:"getContent",value:function(e){return e+="undefined"!=typeof tinymce&&tinymce.activeEditor&&"excerpt"===tinymce.activeEditor.id?tinymce.activeEditor.getContent():this.excerpt.val()}},{key:"events",value:function(){"undefined"!=typeof tinymce&&tinymce.activeEditor&&void 0!==tinymce.editors.excerpt&&tinymce.editors.excerpt.on("keyup change",i()((function(){rankMathEditor.refresh("content")}),500)),this.debounceWCPrice=i()(this.refreshWCPrice,500),this.elemPrice.on("input",this.debounceWCPrice),this.elemRegPrice.on("input",this.debounceWCPrice)}},{key:"refreshWCPrice",value:function(){f.setVariable("wc_price",this.getWooCommerceProductPrice()),(0,o.doAction)("rank_math_update_description_preview")}},{key:"getWooCommerceProductPrice",value:function(){var e=this.elemPrice.val()?this.elemPrice.val():this.elemRegPrice.val();return accounting.formatMoney(e,{symbol:woocommerce_admin_meta_boxes.currency_format_symbol,decimal:woocommerce_admin_meta_boxes.currency_format_decimal_sep,thousand:woocommerce_admin_meta_boxes.currency_format_thousand_sep,precision:woocommerce_admin_meta_boxes.currency_format_num_decimals,format:woocommerce_admin_meta_boxes.currency_format})}}])&&l(r.prototype,n),c&&l(r,c),Object.defineProperty(r,"prototype",{writable:!1}),e}();t()((function(){new p}))}()}(); |