!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e=new RegExp("\\[[^<>&/\\[\\]\0- =]+?( [^\\]]+?)?\\]","g"),f=new RegExp("\\[/[^<>&/\\[\\]\0- =]+?\\]","g");!function(){var a=function(a){this._app=a,this._app.registerPlugin("YoastShortcodePlugin",{status:"loading"}),this.bindElementEvents();var b="("+wpseoShortcodePluginL10n.wpseo_shortcode_tags.join("|")+")";this.keywordRegex=new RegExp(b,"g"),this.closingTagRegex=new RegExp("\\[\\/"+b+"\\]","g"),this.nonCaptureRegex=new RegExp("\\["+b+"[^\\]]*?\\]","g"),this.parsedShortcodes=[],this.loadShortcodes(this.declareReady.bind(this))};a.prototype.declareReady=function(){this._app.pluginReady("YoastShortcodePlugin"),this.registerModifications()},a.prototype.declareReloaded=function(){this._app.pluginReloaded("YoastShortcodePlugin")},a.prototype.registerModifications=function(){this._app.registerModification("content",this.replaceShortcodes.bind(this),"YoastShortcodePlugin")},a.prototype.removeUnknownShortCodes=function(a){return a=a.replace(e,""),a=a.replace(f,"")},a.prototype.replaceShortcodes=function(a){var b=this.parsedShortcodes;if("string"==typeof a&&b.length>0)for(var c=0;c<b.length;c++)a=a.replace(b[c].shortcode,b[c].output);return a=this.removeUnknownShortCodes(a)},a.prototype.loadShortcodes=function(a){var b=this.getUnparsedShortcodes(this.getShortcodes(this.getContentTinyMCE()));if(!(b.length>0))return a();this.parseShortcodes(b,a)},a.prototype.bindElementEvents=function(){var a=document.getElementById("content")||!1,b=_.debounce(this.loadShortcodes.bind(this,this.declareReloaded.bind(this)),500);a&&(a.addEventListener("keyup",b),a.addEventListener("change",b)),"undefined"!=typeof tinyMCE&&"function"==typeof tinyMCE.on&&tinyMCE.on("addEditor",function(a){a.editor.on("change",b),a.editor.on("keyup",b)})},a.prototype.getContentTinyMCE=function(){var a=document.getElementById("content")&&document.getElementById("content").value||"";return"undefined"!=typeof tinyMCE&&void 0!==tinyMCE.editors&&0!==tinyMCE.editors.length&&(a=tinyMCE.get("content")&&tinyMCE.get("content").getContent()||""),a},a.prototype.getUnparsedShortcodes=function(a){if("object"!==(void 0===a?"undefined":d(a)))return console.error("Failed to get unparsed shortcodes. Expected parameter to be an array, instead received "+(void 0===a?"undefined":d(a))),!1;for(var b=[],c=0;c<a.length;c++){var e=a[c];-1===b.indexOf(e)&&this.isUnparsedShortcode(e)&&b.push(e)}return b},a.prototype.isUnparsedShortcode=function(a){for(var b=!1,c=0;c<this.parsedShortcodes.length;c++)this.parsedShortcodes[c].shortcode===a&&(b=!0);return!1===b},a.prototype.getShortcodes=function(a){if("string"!=typeof a)return console.error("Failed to get shortcodes. Expected parameter to be a string, instead received"+(void 0===a?"undefined":d(a))),!1;for(var b=this.matchCapturingShortcodes(a),c=0;c<b.length;c++)a=a.replace(b[c],"");var e=this.matchNonCapturingShortcodes(a);return b.concat(e)},a.prototype.matchCapturingShortcodes=function(a){for(var b=[],c=(a.match(this.closingTagRegex)||[]).join(" ").match(this.keywordRegex)||[],d=0;d<c.length;d++){var e=c[d],f="\\["+e+"[^\\]]*?\\].*?\\[\\/"+e+"\\]",g=a.match(new RegExp(f,"g"))||[];b=b.concat(g)}return b},a.prototype.matchNonCapturingShortcodes=function(a){return a.match(this.nonCaptureRegex)||[]},a.prototype.parseShortcodes=function(a,b){return"function"!=typeof b?(console.error("Failed to parse shortcodes. Expected parameter to be a function, instead received "+(void 0===b?"undefined":d(b))),!1):"object"===(void 0===a?"undefined":d(a))&&a.length>0?void jQuery.post(ajaxurl,{action:"wpseo_filter_shortcodes",_wpnonce:wpseoShortcodePluginL10n.wpseo_filter_shortcodes_nonce,data:a},function(a){this.saveParsedShortcodes(a,b)}.bind(this)):b()},a.prototype.saveParsedShortcodes=function(a,b){a=JSON.parse(a);for(var c=0;c<a.length;c++)this.parsedShortcodes.push(a[c]);b()},window.YoastShortcodePlugin=a}()},{}]},{},[1]);