(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=jQuery;var n=e.n(t);const r=lodash,o=wp.hooks;function i(e){return i="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},i(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}var s=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.productImages=n()(".product_images"),this.events(),this.hooks()},(t=[{key:"hooks",value:function(){(0,o.addFilter)("rank_math_content","rank-math-pro",this.getContent.bind(this),11),(0,o.addFilter)("rankMath_analysis_contentLength","rank-math-pro",this.changeFilteredText.bind(this),11),(0,o.addFilter)("rankMath_analysis_contentLength_boundaries","rank-math-pro",this.contentBoundaries.bind(this),11),(0,o.addAction)("rank_math_data_changed","rank-math-pro",this.refreshResults.bind(this))}},{key:"getContent",value:function(e){return this.productImages.length?(this.productImages.find("li").each(function(){void 0!==n()(this).find("img")[0]&&(e+=n()(this).find("img")[0].outerHTML)}),e):e}},{key:"events",value:function(){this.productImages.length&&this.productImages.on("DOMSubtreeModified",function(){rankMathEditor.refresh("content")})}},{key:"changeFilteredText",value:function(e){return e.failed=e.failed.replace("600","200"),e.emptyContent=e.emptyContent.replace("600-2500","200"),e}},{key:"contentBoundaries",value:function(e,t){return this.canUpdateBoundaries(t)?{recommended:{boundary:200,score:8},belowRecommended:{boundary:150,score:5},medium:{boundary:120,score:4},belowMedium:{boundary:100,score:3},low:{boundary:80,score:2}}:e}},{key:"canUpdateBoundaries",value:function(e){return"product"===rankMath.postType||!!(0,r.isUndefined)(e)||!(0,r.isUndefined)(e.getPostType())&&"product"===e.getPostType()}},{key:"refreshResults",value:function(e){"schemas"===e&&rankMathEditor.refresh("content")}}])&&a(e.prototype,t),i&&a(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}();n()(function(){new s})})();