OwlCyberSecurity - MANAGER
Edit File: module.min.js
window.vc||(window.vc={}),(o=>{window.vc.seo_utils={getTextContent:function(e){e=e.replace(/\s*\bdata-vcv-[^"<>]+"[^"<>]+"+/g,"").replace(/<!--\[vcvSourceHtml]/g,"").replace(/\[\/vcvSourceHtml]-->/g,"").replace(/<\//g," </");for(var t=document.createRange().createContextualFragment(e),n=t.querySelector("style, script, noscript, meta, title, #vc_no-content-helper, .vc_controls");n;)n.parentNode.removeChild(n),n=t.querySelector("style, script, noscript, meta, title, #vc_no-content-helper, .vc_controls");return t&&t.textContent&&t.textContent.trim()},createMeasurementElement:function(){var e=document.createElement("div");return e.id="vc-measurement-element",e.style.position="absolute",e.style.left="-9999em",e.style.top=0,e.style.height=0,e.style.overflow="hidden",e.style.fontFamily="arial, sans-serif",e.style.fontSize="20px",e.style.fontWeight="400",document.body.appendChild(e),e},measureTextWidth:function(e){var t=document.getElementById("vc-measurement-element");return(t=t||this.createMeasurementElement()).innerHTML=e,t.offsetWidth},findKeyphrase:function(e,t){e=e.toLowerCase();t=(t=t.trim().toLowerCase()).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp("\\b"+t+"\\b","gi"),e=Array.from(e.matchAll(t));return e.length?{found:!0,count:e.length,positions:e.map(function(e){return e.index})}:{found:!1,count:0,positions:[]}},slugify:function(e){return e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},findKeyphraseInSlug:function(e,t){t=this.slugify(t),e=this.slugify(e),t=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp("\\b"+t.split("-").join("\\b-\\b")+"\\b","gi"),e=Array.from(e.matchAll(t));return 0<e.length?{found:!0,count:e.length,positions:e.map(function(e){return e.index})}:{found:!1,count:0,positions:[]}},findKeyphraseInAltTag:function(e,t){var n=e.length,r=0;return t=t.trim().toLowerCase(),e.each(function(){var e=o(this).attr("alt");e&&e.toLowerCase().includes(t)&&r++}),{percentage:r/n*100,imagesWithKeyphrase:r}},findKeyphraseDensity:function(e,t){t=t.trim().toLowerCase();var n=e.trim().split(/\s+/).length,t=new RegExp("\\b"+t+"\\b","gi");return{keyphraseOccurrences:e.match(t)||[],advisedMinOccurrences:Math.ceil(.005*n),advisedMaxOccurrences:Math.ceil(.03*n)}},getParagraphs:function(e){var e=e.find("p"),r=[".vc_ui-help-block"];return e=(e=(e=e.filter(function(e,t){var n=o(t);return!r.some(function(e){return n.is(e)})})).filter(function(e,t){return 0<o(t).text().trim().length})).filter(function(e,t){return!(1===o(t).contents().length&&1===o(t).children("a").length)})},getSentences:function(e){return e.match(/\(?[^\.\?\!]+[\.!\?]\)?/g)||[]},hasConsecutiveSentences:function(e){for(var t=this.getSentences(e),n=1,r=1;r<t.length;r++)if(t[r].split(" ")[0]===t[r-1].split(" ")[0]){if(3<=++n)return{consecutiveCount:n,state:!0}}else n=1;return{consecutiveCount:n,state:!1}},getPassiveVoicePercentage:function(e){var n,r=0,i=0;return e.length&&(n=this,e.each(function(e,t){t=n.getSentences(o(t).text());r+=t.length,t.forEach(function(e){n.hasPassiveVoice(e)&&i++})})),(r?i/r*100:0).toFixed(2)},hasPassiveVoice:function(e){return/\b(am|are|is|was|were|been|being)\s+[^.!?]*\b(by)\b/.test(e)},getWordsCount:function(e){e=e.split(/\s/g);return(e=(e=e.reduce(function(e,t){t=t.replace(new RegExp("([ \\–\\-\\(\\)_\\[\\]’‘“”〝〞〟‟„\"'.?!:;,¿¡«»‹›—×+&۔؟،؛。。!‼?⁇⁉⁈‥…・ー、〃〄〆〇〈〉《》「」『』【】〒〓〔〕〖〗〘〙〚〛〜〝〞〟〠〶〼〽{}|~⦅⦆「」、[]・¥$%@&'()*/:;<>\\\<>])","g")," $1 ");return e.concat(t.split(" "))},[])).filter(function(e){return""!==e.trim()})).length},getTextSectionCount:function(e){var e=(new DOMParser).parseFromString(e,"text/html").body.childNodes,r=[];return e.forEach(function(e){var t,n;e.nodeType===Node.ELEMENT_NODE&&(t=(e=e).querySelectorAll("p"),n=0,e=e.querySelectorAll("h1, h2, h3, h4, h5, h6").length,t.forEach(function(e){return n+=(e.textContent||"").trim().split(/\s+/).length}),t={wordCount:n,subheadingCount:e},r.push(t))}),r}}})(window.jQuery); window.vc||(window.vc={}),(a=>{var i="results",r=vc.seo_utils,h={focusKeyphrase:{title:i18nLocale.focusKeywordTitle,checkMethod:"checkFocusKeyphrase",conditions:[]},descriptionLength:{title:i18nLocale.seoDescription,checkMethod:"checkDescriptionLength",conditions:[]},titleWidth:{title:i18nLocale.seoTitle,checkMethod:"checkTitleWidth",conditions:[]},postTextLength:{title:i18nLocale.textLength,checkMethod:"checkPostTextLength",conditions:[]},images:{title:i18nLocale.images,checkMethod:"checkImages",conditions:["content"]},inboundLinks:{title:i18nLocale.internalLinks,checkMethod:"checkInboundLinks",conditions:["content"]},outboundLinks:{title:i18nLocale.outboundLinks,checkMethod:"checkOutboundLinks",conditions:["content"]},consecutiveSentences:{title:i18nLocale.consecutiveSentences,checkMethod:"checkForConsecutiveSentences",conditions:["text","content"]},subheadingDistribution:{title:i18nLocale.subheadingDistribution,checkMethod:"checkSubheadingDistribution",conditions:["text","content"]},paragraphLength:{title:i18nLocale.paragraphLength,checkMethod:"checkParagraphLength",conditions:["text","content"]},passiveVoicePercentage:{title:i18nLocale.passiveVoice,checkMethod:"checkPassiveVoicePercentage",conditions:["text","content"]},checkSentenceLength:{title:i18nLocale.sentenceLength,checkMethod:"checkSentenceLength",conditions:["text","content"]},keyphraseInTitle:{title:i18nLocale.keyphraseInTitleText,checkMethod:"checkKeyphraseInTitle",conditions:["title","keyphrase"]},keyphraseInDescription:{title:i18nLocale.keyphraseInDescriptionText,checkMethod:"checkKeyphraseInDescription",conditions:["description","keyphrase"]},keyphraseInSlug:{title:i18nLocale.keyphraseInSlug,checkMethod:"checkKeyphraseInSlug",conditions:["slug","keyphrase"]},keyphraseInImages:{title:i18nLocale.imageKeyphrase,checkMethod:"checkKeyphraseInImages",conditions:["content","keyphrase","images"]},keyphraseDensity:{title:i18nLocale.keyphraseDensity,checkMethod:"checkKeyphraseDensity",conditions:["content","keyphrase","text"]},keyphraseInIntroduction:{title:i18nLocale.keyphraseInIntroductionText,checkMethod:"checkKeyphraseInIntroduction",conditions:["content","keyphrase","text"]},previouslyUsedKeyphrase:{title:i18nLocale.previouslyUsedKeyphrase,checkMethod:"checkPreviouslyUsedKeyphrase",conditions:["keyphrase"]}};vc.seo_checks={$wpbContentWrapper:null,analyzeContent:function(e){this.$wpbContentWrapper=e;var t,e=this.$wpbContentWrapper.find(">div:not(#vc_no-content-helper)"),n=e.find("p"),o=e.find("img"),s=vc.seo_storage.get("formData"),c={content:e.length,text:n.length,images:o.length,keyphrase:s.keyphrase,title:s.title,description:s.description,slug:s.slug};for(t in h)h[t]&&(h[t].conditions.every(function(e){return c[e]})?this[h[t].checkMethod](h[t].title):vc.seo_storage.resetResult(h[t].title))},checkTitleWidth:function(e){var t="problems",n=i18nLocale.seoTitleWidthTooLong,o=r.measureTextWidth(vc.seo_storage.get("formData").title);o?o<600&&(t="success",n=i18nLocale.goodJob):n=i18nLocale.seoTitleEmpty,vc.seo_storage.updateResult(t,e,n,i)},checkFocusKeyphrase:function(e){var t="problems",n=i18nLocale.noFocusKeyword;vc.seo_storage.get("formData").keyphrase&&(t="success",n=i18nLocale.goodJob),vc.seo_storage.updateResult(t,e,n,i)},checkDescriptionLength:function(e){var t="problems",n="";vc.seo_storage.get("formData").description.length?vc.seo_storage.get("formData").description.length<120?(t="warnings",n=i18nLocale.seoDescriptionTooShort):120<vc.seo_storage.get("formData").description.length&&vc.seo_storage.get("formData").description.length<=156?(t="success",n=i18nLocale.wellDone):156<vc.seo_storage.get("formData").description.length&&(t="warnings",n=i18nLocale.seoDescriptionTooLong):n=i18nLocale.seoDescriptionEmpty,vc.seo_storage.updateResult(t,e,n,i)},checkKeyphraseInTitle:function(e){var t="problems",n=i18nLocale.keyphraseInTitleEmpty.replace("%1$s",vc.seo_storage.get("formData").keyphrase),o=vc.seo_storage.get("formData").title.toLowerCase(),s=vc.seo_storage.get("formData").keyphrase.trim().toLowerCase(),c=r.findKeyphrase(vc.seo_storage.get("formData").title,vc.seo_storage.get("formData").keyphrase),o=0===o.indexOf(s);c.found&&(n=o?(t="success",i18nLocale.goodJob):(t="warnings",i18nLocale.keyphraseInTitleWarn)),vc.seo_storage.updateResult(t,e,n,i)},checkKeyphraseInDescription:function(e){var t="problems",n=i18nLocale.keyphraseInDescriptionEmpty;r.findKeyphrase(vc.seo_storage.get("formData").description,vc.seo_storage.get("formData").keyphrase).found&&(t="success",n=i18nLocale.keyphraseInDescriptionSuccess),vc.seo_storage.updateResult(t,e,n,i)},checkKeyphraseInSlug:function(e){var t="warnings",n=i18nLocale.keyphraseInSlugProblem;r.findKeyphraseInSlug(vc.seo_storage.get("formData").slug,vc.seo_storage.get("formData").keyphrase).found&&(t="success",n=i18nLocale.greatWork),vc.seo_storage.updateResult(t,e,n,i)},checkKeyphraseInImages:function(e){var t="success",n="",o=r.findKeyphraseInAltTag(this.images,vc.seo_storage.get("formData").keyphrase),s=o.percentage,o=o.imagesWithKeyphrase,n=4<this.images.length?30<=s&&s<=70?i18nLocale.goodJob:(70<s?(t="warnings",i18nLocale.imageKeyphraseTooMuch):(t="warnings",i18nLocale.imageKeyphraseNotEnough)).replace("%1$s",this.images.length).replace("%2$s",o):0<o?i18nLocale.goodJob:(t="warnings",i18nLocale.imageKeyphraseMissing);vc.seo_storage.updateResult(t,e,n,i)},checkKeyphraseDensity:function(e){var t="success",n="",o=r.findKeyphraseDensity(this.textContent,vc.seo_storage.get("formData").keyphrase),s=o.keyphraseOccurrences,c=o.advisedMinOccurrences,o=o.advisedMaxOccurrences,n=s.length<c?(t="problems",i18nLocale.keyphraseDensityNotEnough.replace("%1$s",s.length).replace("%2$s",c)):s.length>=c&&s.length<=o?i18nLocale.keyphraseDensitySuccess.replace("%1$s",s.length):(t="problems",i18nLocale.keyphraseDensityTooMuch.replace("%1$s",s.length).replace("%2$s",o));vc.seo_storage.updateResult(t,e,n,i)},checkInboundLinks:function(e){var n=[],t=i18nLocale.goodJob,o=i18nLocale.noInternalLinks,s=this.$wpbContentWrapper.find(">div:not(#vc_no-content-helper) a:not([class*='vc_control'])"),c="success";a.each(s,function(e,t){window.location.host===t.host&&n.push(t)}),n.length||(c="problems",t=o),vc.seo_storage.updateResult(c,e,t,i)},checkOutboundLinks:function(e){var n=[],t=i18nLocale.goodJob,o=i18nLocale.noOutboundLinks,s=this.$wpbContentWrapper.find(">div:not(#vc_no-content-helper) a:not([class*='vc_control'])"),c="success";a.each(s,function(e,t){window.location.host!==t.host&&n.push(t)}),n.length||(c="problems",t=o),vc.seo_storage.updateResult(c,e,t,i)},checkImages:function(e){var t="problems",n=i18nLocale.noImages,o=this.$wpbContentWrapper.find(">div:not(#vc_no-content-helper) img");(this.images=o).length&&(t="success",n=i18nLocale.goodJob),vc.seo_storage.updateResult(t,e,n,i)},checkPostTextLength:function(e){var t="problems",n=i18nLocale.textLengthLess,o=this.$wpbContentWrapper.html(),s=r.getTextContent(o),s=(this.textContent=s).split(/\s+/).length;(s=1===s&&""===r.getTextContent(o).split(/\s+/)[0]?0:s)<200?n=n.replace("%1$s",s).replace("%2$s","far below"):200<=s&&s<250?n=n.replace("%1$s",s).replace("%2$s","below"):250<=s&&s<300?(n=n.replace("%1$s",s).replace("%2$s","slightly below"),t="warnings"):300<=s&&(n=window.sprintf(i18nLocale.textLengthSuccess,s),t="success"),vc.seo_storage.updateResult(t,e,n,i)},checkKeyphraseInIntroduction:function(e){var t="problems",n=i18nLocale.keyphraseInIntroductionEmpty,o=r.getParagraphs(this.$wpbContentWrapper).first().text();r.findKeyphrase(o,vc.seo_storage.get("formData").keyphrase).found&&(t="success",n=i18nLocale.wellDone),vc.seo_storage.updateResult(t,e,n,i)},checkPassiveVoicePercentage:function(e){var t=r.getParagraphs(this.$wpbContentWrapper),t=r.getPassiveVoicePercentage(t),n="problems",o=window.sprintf(i18nLocale.passiveVoiceError,t+"%");t<10&&(n="success",o=i18nLocale.passiveVoiceSuccess),vc.seo_storage.updateResult(n,e,o,i)},checkForConsecutiveSentences:function(e){var t=r.hasConsecutiveSentences(this.textContent),n=t.state?"problems":"success",o=i18nLocale.consecutiveSentencesSuccess;t.state&&(o=i18nLocale.consecutiveSentencesFail.replace("%1$s",t.consecutiveCount)),vc.seo_storage.updateResult(n,e,o,i)},checkParagraphLength:function(e){var t="success",n=i18nLocale.paragraphLengthSuccess,o=r.getParagraphs(this.$wpbContentWrapper),s=0;o.each(function(e,t){t=a(t).text();150<r.getWordsCount(t)&&s++}),0<s&&(n=window.sprintf(i18nLocale.paragraphLengthError,s),t="problems"),vc.seo_storage.updateResult(t,e,n,i)},checkSentenceLength:function(e){var t="success",n=i18nLocale.great,o=r.getParagraphs(this.$wpbContentWrapper),s=0,c=0,o=(o.each(function(e,t){t=r.getSentences(a(t).text());s+=t.length,t.forEach(function(e){20<r.getWordsCount(e)&&c++})}),c/s*100);1!==s&&25<o&&(n=window.sprintf(i18nLocale.sentenceLengthError,o.toFixed()),t="problems"),vc.seo_storage.updateResult(t,e,n,i)},checkSubheadingDistribution:function(e){var t=this.$wpbContentWrapper.html(),t=r.getTextSectionCount(t),n="success",o=i18nLocale.goodJob,s=t.filter(function(e){return!e.subheadingCount&&300<e.wordCount}),t=t.filter(function(e){return 1===e.subheadingCount&&300<e.wordCount});s.length?(n="problems",o=i18nLocale.subheadingDistributionFail):t.length&&(n="warnings",o=i18nLocale.subheadingDistributionWarn.replace("%s",t.length)),vc.seo_storage.updateResult(n,e,o,i)},checkPreviouslyUsedKeyphrase:function(e){var t="success",n=i18nLocale.previouslyUsedKeyphraseSuccess;vc.seo_storage.get("formData").isUsedKeyphrase&&(t="warnings",n=i18nLocale.previouslyUsedKeyphraseWarn),vc.seo_storage.updateResult(t,e,n,i)}}})(window.jQuery); window.vc||(window.vc={}),(n=>{var e=Backbone.Model.extend({defaults:{formData:{keyphrase:"",title:"",description:"",slug:"",isUsedKeyphrase:""},results:[]},setResults:function(e,t,s){var i,r,a=this.get(s);"focus-keyphrase"===t&&(t="keyphrase",e)&&e!==this.get(s).keyphrase&&(i=this,r={action:"wpb_seo_check_key_phrase",key_phrase:e,post_id:window.vc_post_id,_vcnonce:window.vcAdminNonce},n.ajax({type:"POST",url:window.ajaxurl,data:r}).done(function(e){e.success&&(a.isUsedKeyphrase=e.data,i.set(s,a),i.trigger("formData","change",a))}).fail(function(e){console.error("Failed to get the previously used keyphrase response: "+e)})),a[t]=e,this.set(s,a),"formData"===s&&this.trigger("formData","change",a)},updateResult:function(e,t,s){var i={state:e,title:t,description:s},e=this.get("results").slice(),t=e.findIndex(function(e){return e.title===i.title});-1!==t?(e[t]=i,this.trigger("resultChanged","update",i)):(e.push(i),this.trigger("resultChanged","add",i)),this.set("results",e)},resetResult:function(t){var e=this.get("results").filter(function(e){return e.title!==t});this.set("results",e)}});vc.seo_storage=new e})(window.jQuery); window.vc||(window.vc={}),(s=>{vc.SeoAnalysisView=Backbone.View.extend({$wpbContentWrapper:null,$navbarIcon:null,currentBadge:"",initialize:function(){this.$wpbContentWrapper=this.getContentWrapper(),this.$navbarIcon=s(".vc_seo-button"),vc.seo_utils.createMeasurementElement(),vc.seo_checks.analyzeContent(this.$wpbContentWrapper),this.render(),this.setIconBadge(),this.setEvents()},render:function(){vc.seo_checks.analyzeContent(this.$wpbContentWrapper);var e=this.getNotificationsHtml();this.$el.html(e),this.setIconBadge()},setEvents:function(){this.debouncedRender=_.debounce(this.render,200),this.listenTo(this.model,"formData",this.debouncedRender),"admin_frontend_editor"===window.vc_mode?(vc.events.on("afterRender",this.debouncedRender,this),vc.events.on("shortcodeView:updated",this.debouncedRender,this),vc.events.on("afterLoadShortcode",this.debouncedRender,this)):(vc.events.on("shortcodes:update",this.debouncedRender,this),vc.events.on("shortcodes:add",this.debouncedRender,this),vc.events.on("undoredo:undo",this.debouncedRender,this),vc.events.on("undoredo:redo",this.debouncedRender,this)),vc.events.on("shortcodes:destroy",this.debouncedRender,this)},getNotificationsHtml:function(){var t=this,e=this.model.get("results"),n={success:[],problems:[],warnings:[]},s=(e.forEach(function(e){n[e.state].push(e)}),[]),o=["problems","warnings","success"];return Object.keys(n).sort(function(e,t){return o.indexOf(e)-o.indexOf(t)}).forEach(function(e){n[e].length&&(e=t.getResultsHtml(e,n[e]),s.push(e))}),s},setIconBadge:function(){function e(t){return n.find(function(e){return t===e.state})}var t="success",n=this.model.get("results");e("problems")?t="problems":e("warnings")&&(t="warnings"),this.$navbarIcon.removeClass(this.currentBadge),this.currentBadge="vc_ui-badge--"+t,this.$navbarIcon.addClass(this.currentBadge)},getResultsHtml:function(e,t){var e=s('<div class="vc_ui-seo-results-section"><strong>'+window.i18nLocale[e]+'</strong><ul class="vc_ui-seo-results-list"></ul></div>'),n=e.find("ul");return s.each(t,function(e,t){t=s('<li class="vc_ui-seo-results-list-item vc_ui-seo-results-list-item--'+t.state+'">'+t.title+": "+t.description+"</li>");n.append(t)}),e},getContentWrapper:function(){return"admin_frontend_editor"===window.vc_mode?vc.$frame.contents().find(".wpb-content-wrapper"):s("#wpbakery_content")}}),vc.events.on("app.render",function(){setTimeout(function(){vc.seo_analysis_view=new vc.SeoAnalysisView({el:"#vc_ui-seo-analysis",model:vc.seo_storage})},1e3)})})(window.jQuery); window.vc||(window.vc={}),(c=>{var a="formData";window.vc.PostSettingsSeoUIPanel=vc.PostSettingsSeoUIPanelView.vcExtendUI(vc.HelperPanelViewHeaderFooter).vcExtendUI(vc.HelperPanelViewResizable).vcExtendUI(vc.HelperPanelViewDraggable).extend({el:"#vc_ui-panel-post-seo",panelName:"post_seo",events:{'click [data-vc-ui-element="button-close"]':"hide",'click [data-vc-ui-element="panel-tab-control"]':"changeTab",'click [data-vc-ui-element="button-save"]':"save",'click [data-vc-ui-element="button-minimize"]':"toggleOpacity","click .vc_icon-remove":"removeImage","change #vc_ui-seo-social .gallery_widget_attached_images_ids":"updateImagePreview","input #social-title-x, #social-title-facebook":"updateTitlePreview","input #social-description-x, #social-description-facebook":"updateDescriptionPreview","click #preview-dots, #vc_seo-title, #vc_description-container":"focusTarget",'change .vc-preview-radio input[type="radio"]':"changePreviewMode","input #vc_seo-title-field, #vc_seo-description-field, #vc_seo-slug-field":"updateGeneralPreviewText","blur #vc_seo-title-field, #vc_seo-description-field":"fillSocialInputs","change #vc_focus-keyphrase-field, #vc_seo-title-field, #vc_seo-description-field, #vc_seo-slug-field, #social-title-facebook, #social-description-facebook, #social-title-x, #social-description-x":"handleInputChange"},initialize:function(){_.bindAll(this,"fixElContainment","setSize"),this.on("setSize",this.setResize,this),this.setFormDataState()},render:function(e,t){this.$el.is(":hidden")&&vc.closeActivePanel(),(vc.active_panel=this).show()},show:function(){var e;this.$el.hasClass("vc_active")||(this.$el.addClass("vc_active"),this.draggable||this.initDraggable(),this.fixElContainment(),this.trigger("show"),(e=this.$el.find(".vc_panel-tab")).length&&(this.$tabs=e))},changeTab:function(e){e.preventDefault();e=c(e.currentTarget).parent(),c('[data-vc-ui-element="panel-add-element-tab"].vc_active').removeClass("vc_active"),e.addClass("vc_active"),this.$tabs.filter(".vc_active").removeClass("vc_active"),e=e.data("tabIndex");this.$tabs.filter('[data-tab-index="'+e+'"]').addClass("vc_active")},removeImage:function(e){var t=c(e.currentTarget),i=t.closest(".edit_form_line"),a=i.attr("data-social-net-preview-slug"),a=c("#"+a);a.find(".wpb-social-placeholder-image").show(),a.find("img").attr("src",""),i.find(".gallery_widget_attached_images_ids").val(""),e&&e.preventDefault&&e.preventDefault(),t.parent().remove()},updateImagePreview:function(e){var t,e=c(e.currentTarget).closest(".edit_form_line"),i=e.find(".inner img").attr("src"),e=e.attr("data-social-net-preview-slug");e&&i&&(i=i.replace("-150x150",""),(t=(e=c("#"+e)).find("img")).attr("src",i),t.show(),e.find(".wpb-social-placeholder-image").hide())},updateTitlePreview:function(e){e=c(e.currentTarget);e.closest(".vc_seo-social-block").find(".wpb-social-net-preview .vc_social-title").text(e.val())},updateDescriptionPreview:function(e){var e=c(e.currentTarget),t=e.closest(".vc_seo-social-block"),e=e.val();t.find(".wpb-social-net-preview .vc_social-description").text(e),t.find(".vc_social-description-counter").text(e.length)},focusTarget:function(e){e=c(e.currentTarget).data("focus");c("#"+e).focus()},changePreviewMode:function(e){var t=this.$el.find(".page-preview");"mobile"===c(e.currentTarget).val()?t.removeClass("desktop-view"):t.addClass("desktop-view")},createSlug:function(e){e=e.toLowerCase();return e=(e=(e=e.replace(/\s+/g,"-")).replace(/[^a-zA-Z0-9\-]/g,"")).replace(/^[.,!?()[]{}<>:;]+|[.,!?()[]{}<>:;]+$/g,"")},updateGeneralPreviewText:function(e){var t=c(e.currentTarget).val(),e=("vc_seo-slug-field"===c(e.currentTarget).attr("id")&&(t=this.createSlug(t)),c(e.currentTarget).data("preview")),e=this.$el.find("#"+e);e&&e.text(t)},handleInputChange:function(e){var t=e.target.value.trim();vc.seo_storage.setResults(t,e.target.name,a)},setFormDataState:function(){this.$el.find("#vc_ui-seo-general").find('input[type="text"], textarea').each(function(e,t){var i=c(t).attr("name"),t=c(t).val();vc.seo_storage.setResults(t,i,a)}),this.$el.find("#vc_ui-seo-social").find('input[type="text"], textarea').each(function(e,t){var i=c(t).attr("name"),t=c(t).val();vc.seo_storage.setResults(t,i,a)})},fillSocialInputs:function(e){var t=c(e.currentTarget).val(),e=c(e.currentTarget).attr("name"),i=vc.seo_storage.get("formData"),a={title:["social-title-x","social-title-facebook"],description:["social-description-x","social-description-facebook"]};a[e]&&a[e].forEach(function(e){i[e]||c("#"+e).val(t).trigger("input")})}})})(window.jQuery);