Duplicate Post - Version 1.1.5

Version Description

  • Tested up to WordPress 5.6.2
  • Fixed footer issue in Gutenberg editor
  • Fixed notice in premium version (regarding new option)
  • Added posibility to hide menu under tools
Download this release

Release Info

Developer copydelete
Plugin Icon wp plugin Duplicate Post
Version 1.1.5
Comparing to
See all releases

Code changes from version 1.1.4 to 1.1.5

assets/js/cdp.min.js CHANGED
@@ -1 +1 @@
1
- function cdp_tooltips_update_content(){if(jQuery("select").niceSelect("update"),!(void 0!==jQuery.cdp&&void 0!==jQuery.cdp.isPremium)||!jQuery.cdp.isPremium()){jQuery(".cdp-premium-in-select").find('.option[data-value="premium"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-option-premium").find('.option[data-value="3"]').addClass("cdp-tooltip-premium disabled"),$prems=jQuery(".cdp-tooltip-premium");for(let t=0;t<$prems.length;t++){let e=$prems[t],o=-15;isNaN(parseInt(jQuery(e).attr("data-top")))||(o=parseInt(jQuery(e).attr("data-top"))),jQuery(e).tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:o,side:"top",content:'This is a Premium Feature.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Check it out and upgrade today</a>,<br>we made it <b>really affordable!</b>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0})}jQuery(".cdp-tooltip-premium-dc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This is a Premium Feature.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Check it out and upgrade today</a>,<br>we made it <b>really affordable!</b>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0})}}function cdp_totally_know_what_i_am_doing(t){if("really"!=t)return"Are you REALLY sure?";console.log("You're crazy! – Here is the output:");let e=jQuery;e("#cdp-purl").val();e.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"debug_function"}).done(t=>{console.log(t),console.log("–––––––––––––- END OF THE DEBUG OUTPUT –––––––––––––- ")})}jQuery(document).ready(function(t){t("#cdp-purl").val();let e=null,o="default",i=null,c=null,n=null,d=null,p=null,s=null,a=null;const l=void 0!==t.cdp&&void 0!==t.cdp.isPremium;function r(e=null,o=!1){let i=this;"string"==typeof e&&(i=`.${e}`),0!=o&&(i=o),$parent=t(t(i).parents(".cdp-collapsible")[0]),$arrow=$parent.find(".cdp-arrow"),$body=$parent.find(".cdp-collapsible-content"),$title=$parent.find(".cdp-collapsible-title"),$titles=t(".cdp-collapsible-title"),group=$parent.attr("data-cdp-group"),height=$body.prop("scrollHeight"),$oArrows=t(`.cdp-collapsible[data-cdp-group="${group}"]`).not($parent).find(".cdp-arrow"),$oBodies=t(`.cdp-collapsible[data-cdp-group="${group}"]`).not($parent).find(".cdp-collapsible-content"),$body.hasClass("cdp-active")?($body.removeClass("cdp-active"),$titles.removeClass("cdp-active"),$oBodies.removeClass("cdp-active"),$arrow.removeClass("cdp-arrow-down").addClass("cdp-arrow-left"),$body.css({"max-height":""})):($titles.removeClass("cdp-active"),$body.addClass("cdp-active"),$title.addClass("cdp-active"),$oBodies.removeClass("cdp-active"),$arrow.removeClass("cdp-arrow-left").addClass("cdp-arrow-down"),$oArrows.removeClass("cdp-arrow-down").addClass("cdp-arrow-left"),$body.css({"max-height":`${height+30}px`}),$oBodies.css({"max-height":""}))}function u(){let e=t(".cdp-names-prefix").text(),o=t(".cdp-names-suffix").text(),i={year:(c=new Date).getFullYear(),month:("0"+(c.getMonth()+1)).slice(-2),day:c.getDate()<=9?"0"+c.getDate():c.getDate(),hour:c.getHours()<=9?"0"+c.getHours():c.getHours(),minute:c.getMinutes()<=9?"0"+c.getMinutes():c.getMinutes(),second:c.getSeconds()<=9?"0"+c.getSeconds():c.getSeconds(),week:c.getDay()};var c;let n="(blank)"==t(".cdp-togglable-name-b").text()?"":"(Name of original)",d=`${e.trim()} ${n} ${o.trim()}`;d=d.replace(/\[Counter\]/g,"2");let p=t(".cdp-date-picked").val();"1"==p?d=d.replace(/\[CurrentDate\]/g,`${i.month}/${i.day}/${i.year}`):"2"==p?d=d.replace(/\[CurrentDate\]/g,`${i.day}/${i.month}/${i.year}`):"3"==p&&function(e){let o=t(".cdp-custom-date-picking").val();t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_formatted_time",format:o}).done(t=>{e(t)}).fail(()=>{e(!1)})}(e=>{d=d.replace(/\[CurrentDate\]/g,`${e}`),t(".cdp-example-name").text(d),d=(d=d.replace(/\[CurrentTime\]/g,`${i.hour}:${i.minute}:${i.second}`)).replace(/\s+/gim," "),t(".cdp-example-name").text(d)}),"3"!=p&&(d=(d=d.replace(/\[CurrentTime\]/g,`${i.hour}:${i.minute}:${i.second}`)).replace(/\s+/gim," "),t(".cdp-example-name").text(d))}function h(e=""){before=t(e).html(),text=t(e).html(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],text=text.replace(/\[Counter\]/g,$picks[0]),text=text.replace(/\[CurrentDate\]/g,$picks[2]),text=text.replace(/\[CurrentTime\]/g,$picks[1]),text!=before&&t(e).html(text)}function m(){val=t('.cdp-other-options[name="after_copy"]').val(),2==val?t(".cdp-if-edit-page-selected").show(300):t(".cdp-if-edit-page-selected").is(":hidden")||t(".cdp-if-edit-page-selected").hide(300),setTimeout(()=>{jQuery(".cdp-oth-section").css({"max-height":""}),jQuery(".cdp-oth-section").css({"max-height":jQuery(".cdp-oth-section").height()})},310)}function f(i=!1){let c=t(this).attr("data-cdp-btn");1==i&&(c="copy-quick");let n=["copy-quick","copy-custom","copy-custom-link"],d=t(".cdp-modal-checkboxes").find(".cdp-input-dynamic");if(n.includes(c)){let i={type:c};if(c==n[0]){if(i.times=t(".cdp-modal-input-times-tooltip").val(),i.site=t('.cdp-input-dynamic[name="tooltip-which-site-first"]').val(),i.profile=t('.cdp-input-dynamic[name="tooltip-which-profile-first"]').val(),i.swap="2"==t(".cdp-swap").val()?"true":"false",!i.profile||"custom"==i.profile)return t.cdpNotification("warning","Please select settings for this copy."),void w()}else if(c==n[1]||c==n[2]){i.times=t('.cdp-modal-input-times[name="tooltip-which-times-second"]').val(),i.site=t('.cdp-input-dynamic[name="tooltip-which-site-second"]').val(),i.profile=t('.cdp-input-dynamic[name="tooltip-which-profile-second"]').val(),i.swap="2"==t(".cdp-swap").val()?"true":"false",i.custom={};for(let e=0;e<d.length;++e)i.custom[t(d[e]).attr("name")]=t(d[e]).is(":checked")}if(isNaN(parseInt(i.times))||parseInt(i.times)<=0)return void t.cdpNotification("warning","You need to insert positive number for copies.");i.profile&&!["custom","clear","custom_named"].includes(i.profile)||(i.profile=o),z(),function(e=(()=>{})){window.onbeforeunload=(()=>"Copy in progress..."),$e=t(".cdp-copy-loader-overlay"),$e.is(":hidden")&&($e.show(),$e.animate({opacity:1},300,function(){e(!0)}))}(()=>{t.ajax({type:"POST",url:ajaxurl,data:{action:"cdp_action_handling",token:"cdp",f:"copy_post",origin:"tooltip",id:[e],data:i},timeout:0}).done(function(e){w(),t.isJsonString(e)&&(e=t.cdpParse(e)),"error"==e.status?t.cdpNotification("error","Something went wrong and we couldn't copy this post – please try again!"):c==n[2]||void 0!==e.link&&e.link.length>0?"pConv"==e.link?(t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"delete_success_img"}),"-28"==t(".cdp-copy-alert-success").position().top&&t(".cdp-copy-alert-success").animate({top:"32px",opacity:1},300),setTimeout(()=>{"32"==t(".cdp-copy-alert-success").position().top&&t(".cdp-copy-alert-success").animate({top:"-28px",opacity:0},300)},3e3)):window.location.href=e.link:location.reload()}).fail(function(e){t.cdpNotification("error","Something went wrong and we couldn't copy this post. – See dev console for more info."),w(),console.log(e),console.log(e.responseText)})})}else t.cdpNotification("Couldn't recognize that button, please try again.")}function g(e,i=!1){let c=t('.cdp-input-dynamic[name="tooltip-which-profile-second"]'),n=t(".cdp-modal-checkboxes").find(".cdp-input-dynamic"),d=c.length>1?t(t(c[1])):t(t(c[0]));t(c[1])&&t(c[1])||(null==t(c[1])&&t(c[0])?d=t(t(c[0])):null==t(c[0])&&t(c[1])&&(d=t(t(c[1]))));let p=d.val();0==e&&(p=i),"custom_named"==p?c.val("custom_named"):"custom"==p||null==p||null==p?c.val("custom"):"clear"==p?(0!=e&&e.preventDefault(),n.prop("checked",!1),c.val("custom")):!["clear","custom","custom_named"].includes(p)&&p.length>=1?v(p,function(e){for(let o in e)"object"!=typeof o&&t(`.cdp-input-dynamic[name="${o}"]`).prop("checked",y(e[o]))}):(0!=e&&e.preventDefault(),t.cdpNotification("warning","Unable to recognize selected profile, please try again.")),0==e&&c.val(p),["clear","custom","custom_named"].includes(p)||(o=p),cdp_tooltips_update_content()}function y(t){return"string"==typeof t&&"true"==t.trim().toLowerCase()}function v(e="default",o){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_settings",profile:e}).done(e=>{if(t.isJsonString(e)&&(e=t.cdpParse(e)),e.status&&"error_no_exists"==e.status){t.cdpNotification("warning","Profile you selected is just empty, please update this profile or use custom settings!");let e={},i=t(".cdp-modal-option-r");for(let o=0;o<i.length;o++)e[t(i[o]).attr("name")]=t(i[o]).is(":checked");o(!1)}else o(e)}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't get profile settings. – Check console for more details"),console.log("Copy & Delete Post – Error"),console.log(e),console.log("––––––––––––––––––––––––––"),o(!1)})}function b(){t(this).attr("class");let e=parseInt(t(this).val());e<=0&&(e=1),e>9999&&(e=9999),isNaN(e)&&(e=1),e||(e=1),t(".cdp-modal-input-times").val(e),t(".cdp-modal-input-times-tooltip").val(e),e>50?(t(".cdp-error-span-tooltip").show(300),t(".cdp-tooltip-before").attr("style","height: calc(225px - 20px - 16px) !important")):(t(".cdp-error-span-tooltip").hide(300),t(".cdp-tooltip-before").attr("style","")),e>1?(t(".cdp-multiple-tooltip-count").animate({opacity:1},200),t('.cdp-tooltip-btn-copy[data-cdp-btn="copy-custom-link"]').hide()):(t(".cdp-multiple-tooltip-count").animate({opacity:0},200),t('.cdp-tooltip-btn-copy[data-cdp-btn="copy-custom-link"]').show()),setTimeout(()=>{L()},310)}function w(e=(()=>{})){window.onbeforeunload=null,$e=t(".cdp-copy-loader-overlay"),$e.is(":hidden")||$e.animate({opacity:0},300,function(){$e.hide(),e(!0)})}function x(){let e=t(".cdp-profile-selected").val();var o,i;v(e,c=>{if(t.isJsonString(c)||"object"==typeof c){"object"!=typeof c&&(c=JSON.parse(c));let n=["usmplugin","yoast","woo"];for(k in c)"names"==k?(t(".cdp-names-prefix").html(c[k].prefix),t(".cdp-names-suffix").html(c[k].suffix),"3"!=c[k].format||l||(c[k].format="1"),t(".cdp-date-picked").val(c[k].format),t(".cdp-custom-date-picking").val(c[k].custom)):(!n.includes(k)||n.includes(k)&&l&&t.cdp.isPremium())&&t(`.cdp-data-set[data-cdp-opt="${k}"]`).prop("checked","true"==c[k]);cdp_tooltips_update_content(),u(),m(),l&&t.cdp.isPremium()&&t.cdp.premium.detectChangeOfCustom(),T(),h(".cdp-names-prefix"),h(".cdp-names-suffix"),o=e,i=(()=>{}),t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"set_default_profile",selection:o}).done(t=>{i(t)}).fail(()=>{i(!1)})}else t.cdpNotification("warning","There was an error while getting data from server, please try again.")})}function $(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=t(".cdp-input-d-id").length,o=t(".cdp-input-d-id:checked").length;o==e?t(".cdp-d-select-all").text("Deselect all"):t(".cdp-d-select-all").text("Select all"),t(".cdp-t-d-ct").text(o),$visible=t(".cdp-input-d-id:visible").length,$visible_checked=t(".cdp-input-d-id:checked:visible").length,$visible==$visible_checked?t(".cdp-d-checkbox-all").prop("checked",!0):t(".cdp-d-checkbox-all").prop("checked",!1),function(){let e=t(".cdp-input-d-id").parents("tr"),o=t(".cdp-input-d-id:checked").parents("tr");e.removeClass("cdp-del"),o.addClass("cdp-del")}()}function _(e){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"give_me_current_tasks"}).done(o=>{t.isJsonString(o)&&(o=t.cdpParse(o)),"success"==o.status&&e(o.tasks)})}function C(e){let o=0,i=+new Date/1e3,c=t(".cdp-dd-item");for(let i=0;i<c.length;++i){e[t(c[i]).attr("data-token")]||t(c[i]).remove(),o++}for(task in e){let c=e[task],n=t(t(`.cdp-dd-item[data-token="${task}"]`)[0]);if(0==c.done){if(n.hasClass("cdp-dd-ud"))continue;{n.remove();let e=i-c.done>=86400;t(".cdp-dd-undone-list").append(P(c.shown,task,e,c.f)),o++}}else{if(n.hasClass("cdp-dd-d"))continue;n.remove(),t(".cdp-dd-done-list").append(S(c.data,c.shown,task,c.f)),o++}}(o>0||0==c.length)&&function(){let e=t(".cdp-dd-item").length,o=t(".cdp-dd-d").length,i=t(".cdp-dd-ud").length;o<=0?(t(".cdp-done-notis, .cdp-done-notis").addClass("cdp-noti-hide"),t(".cdp-done-hr, .cdp-done-notis").hide()):(t(".cdp-done-notis, .cdp-done-notis").removeClass("cdp-noti-hide"),t(".cdp-done-hr, .cdp-done-notis").show()),i<=0?(t(".cdp-undone-notis, .cdp-undone-notis").addClass("cdp-noti-hide"),t(".cdp-undone-hr, .cdp-undone-notis").hide()):(t(".cdp-undone-notis, .cdp-undone-notis").removeClass("cdp-noti-hide"),t(".cdp-undone-hr, .cdp-undone-notis").show()),e<=0?t(".cdp-admin-bar-noti").addClass("cdp-noti-hide"):t(".cdp-admin-bar-noti").removeClass("cdp-noti-hide"),t(".cdp-notis-counter").text(t(".cdp-bnew-notis").length)}()}function T(){$trs=t(".cdp-table tbody.cdp-ff-b1").find("tr");for(let e=0;e<$trs.length;e++){let o=t($trs[e]);o.find("input").is(":checked")?o.addClass("cdp-selected-tr-opt"):o.removeClass("cdp-selected-tr-opt")}}function j(e){if(t(".cdp-modal").is(":visible"))return;let o=window;0!=t("#wpbody").scrollTop()&&(o="#wpbody");let i=t(o).scrollTop()+2;i<=0&&(i=2),"click"!=e.type&&t(".nice-select, .nice-select .list").css({transition:"all 0s"}),t(".nice-select .list").css({"margin-top":`${-i}px`}),t("#cdpp-af-author").length>0&&(t(".ui-autocomplete").css({top:`${t("#cdpp-af-author").offset().top+40}px`}),t(".cdp-cool-datepicker").css({top:`${t(".cdpp-input-a").offset().top+40}px`})),clearTimeout(d),d=setTimeout(()=>{t(".nice-select .list").css({transition:""})},100),clearTimeout(n),n=setTimeout(()=>{let i=t(o).scrollTop()+2;i<=0&&(i=2),"click"!=e.type&&t(".nice-select .list").css({transition:"all 0s !important"}),t(".nice-select .list").css({"margin-top":`${-i}px`}),t("#cdpp-af-author").length>0&&(t(".ui-autocomplete").css({top:`${t("#cdpp-af-author").offset().top+40}px`}),t(".cdp-cool-datepicker").css({top:`${t(".cdpp-input-a").offset().top+40}px`})),clearTimeout(d),d=setTimeout(()=>{t(".nice-select .list").css({transition:""})},100)},100)}function N(){let e=t('.cdp-d-option[name="cdp-d-b-title"]').is(":checked"),o=t('.cdp-d-option[name="cdp-d-b-slug"]').is(":checked");e||o?t(".cdp-no-empty-text").html("<b>including</b> empty"):t(".cdp-no-empty-text").html("only if <u><b>not</b></u> empty")}function D(e){e.preventDefault(),$parent=t(this).parents(".cdp-collapsible"),$col=t(t($parent[0]).find(".cdp-collapsible-title")[0]),r("true",$col)}t(".cdp-intro-button").on("click",function(){let e=t(".cdp-intro").height();t(".cdp-intro").css({height:e+"px"}),t(".cdp-intro").animate({opacity:0,height:0},300,function(){t(".cdp-intro").hide(10),t("#cdp-never-intro").is(":checked")&&t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"no_intro"}).done(e=>{"error"==e&&t.cdpNotification("error","Something went wrong and we couldn't save intro settings!")}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't save intro settings.")})}),t(".cdp-s-i-a").show(),t(".cdp-s-i-a").animate({opacity:1},300)}),t(".cdp-save-options").on("click",function(){let e=t(".cdp-data-set"),o=t(".cdp-other-inputs"),i=t(".cdp-profile-selected").val(),c=t(".cdp-names-prefix").text().replace(/\s+/g," ").trim(),n=t(".cdp-names-suffix").text().replace(/\s+/g," ").trim(),d={names:{prefix:c,suffix:n,format:t(".cdp-date-picked").val(),custom:t(".cdp-custom-date-picking").val(),display:t(t(`option[value="${t(".cdp-profile-selected").val()}"]`)[0]).text()}},p={afterCopy:t('.cdp-other-options[name="after_copy"]').val(),postConverter:t('.cdp-other-options[name="post_converter"]').val(),others:{}},s={},a=t(".cdp-other-roles");for(let e=0;e<a.length;e++)s[t(a[e]).attr("name")]=t(a[e]).is(":checked");p.roles=s;for(let o=0;o<e.length;o++)d[t(e[o]).attr("data-cdp-opt")]=!!t(e[o]).is(":checked");for(let e=0;e<o.length;e++)p.others[t(o[e]).attr("name")]=!!t(o[e]).is(":checked");t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"save_options",options:d,profile:i,entire:p}).done(e=>{"success"==e?t.cdpNotification("success","All your settings were saved!",2e3):"error"==e?t.cdpNotification("error","Something went wrong and we couldn't save your settings."):t.cdpNotification("success","All your settings were saved!",2e3)}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't save your settings. – Please check console for more info."),console.log(e)})}),t("#cdp-show-into-again").on("click",function(){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"intro_again"}).done(e=>{"error"==e&&t.cdpNotification("error","Something went wrong and we couldn't update intro settings – try again!")}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't update intro settings. – Please check console for more info.")}),t(".cdp-s-i-a").animate({opacity:0},300,function(){t(".cdp-s-i-a").hide()}),function(){t(".cdp-intro").show().css({height:""});let e=t(".cdp-intro").height();t(".cdp-intro").css({height:"0px"}),t(".cdp-intro").animate({opacity:1,height:e+"px"},300,function(){})}()}),t(".cdp-show-projects").on("click",function(){t(".cdp-projects").is(":hidden")&&t(".cdp-projects").show(300);t(".cdp-show-projects").removeClass("cdp-pointer").animate({opacity:.5},300)}),t(".cdp-project-box").on("mouseenter",function(){t(".cdp-project-box").not(t(this)).addClass("cdp-half-opacity")}),t(".cdp-project-box").on("mouseleave",function(){t(".cdp-project-box").removeClass("cdp-half-opacity")}),t(".cdp-collapsible-title").on("click",r),t(".cdp-magic-input").on("keyup change",function(){before=t(this).html(),text=t(this).html(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],text=text.replace(/\[Counter\]/g,$picks[0]),text=text.replace(/\[CurrentDate\]/g,$picks[2]),text=text.replace(/\[CurrentTime\]/g,$picks[1]),text!=before&&t(this).html(text)}),t(".cdp-magic-input").on("focus",function(e,o){if(o)return;let i=t(this).text();" "!=i[0]&&(i="&nbsp;"+i);" "!=i[i.length-1]&&(i+="&nbsp;");t(this).html(i),h(this)}),t(".cdp-magic-input").on("mouseup",".cdp-name-box-small",function(){t(this).hide(300),setTimeout(()=>{t(this).remove(),u()},300)}),t(".cdp-support-animated").on("mouseenter",function(){t(".cdp-support-animated").not(t(this)).addClass("cdp-half-opacity")}),t(".cdp-name-clickable").on("mouseup",function(e){if(e.preventDefault(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],$box={1:".cdp-names-prefix",2:".cdp-names-real-input",3:".cdp-names-suffix"},t($box[e.which]).append($picks[t(this).attr("data-cdp-val")]),u(),e.which==e)return!1}),t(".cdp-support-animated").on("mouseleave",function(){t(".cdp-support-animated").removeClass("cdp-half-opacity")}),t(".cdp-f-einput-n").on("click","button",function(){let e=t(t(this).parents(".cdp-cf")[0]).find("input"),o=t(this).text(),i="12";"V"==o[0]?i="-51":"D"==o[0]&&(i="23");if(e.val().trim().length<=0)return void t.cdpNotification("warning","Please enter license key, currently it is empty.");t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"i_love_squirrels",rat:e.val(),m:i}).done(o=>{t.isJsonString(o)&&(o=t.cdpParse(o)),"success"==o.status?"valid"==o.data.license?(t.cdpNotification("success","License is already active, let us reload the page!"),setTimeout(()=>{window.location.reload()},2e3)):"site_inactive"==o.data.license?(t.cdpNotification("success","License is valid, press the button again to activate!"),e.prop("disabled",!0),t(this).text("Activate")):void 0!==o.data&&void 0!==o.data.msg?(t.cdpNotification("success",o.data.msg),setTimeout(()=>{window.location.reload()},2e3)):t.cdpNotification("warning","Unknown response, please try refresh the page!"):"fail"==o.status?t.cdpNotification(o.fail.type,o.fail.msg):t.cdpNotification("error","Something went wrong and we couldn't send request, please try refresh page and try again.")}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't send request, are you connected to the internet?")})}),t(".cdp-names-real-input, .cdp-date-picked").on("keyup change",u),t('.cdp-other-options[name="after_copy"]').on("change",m),t("body").on("change keyup",".cdp-input-dynamic",function(){$input=t(t(".cdp-tooltip-content, .cdp-modal-content").find(`[name="${t(this).attr("name")}"]`)),"checkbox"==t(this).attr("type")?$input.prop("checked",t(this).is(":checked")):t($input).is("select")?($input.val(t(this).val()),t($input).hasClass("cdp-modal-input-profiles-r")&&g(!1,t(this).val())):$input.val(t(this).val());if(cdp_tooltips_update_content(),t($input).is("select")&&t($input).hasClass("cdp-premium-modal-dropdown")){let e=t("div.cdp-premium-modal-dropdown"),o=t(t(this).parents("div")[0]).find("div.cdp-premium-modal-dropdown");"2"==o.find("li.selected").data("value")?(e.find("span.current").addClass("cdp-relative"),e.find("span.current").html('Change the type of this copy <span class="cdp-premium-icon cdp-big-icon"></span>')):e.find("span.current").removeClass("cdp-relative")}}),t("body").on("click",".cdp-tooltip-before-button",function(){let e=t('.cdp-input-dynamic[name="tooltip-which-profile-first"]').val();"custom"!=e&&g(!1,e);t(".cdp-tooltip-before-options").hide(200),setTimeout(()=>{t(".cdp-tooltip-full-options").show(200),setTimeout(()=>{L()},200)},200)}),t("body").on("click",".cdp-tooltip-btn-copy",f),t("body").on("change",'.cdp-input-dynamic[name="tooltip-which-profile-second"]',g),t("body").on("change",'.cdp-input-dynamic[name="tooltip-which-profile-first"]',function(){g(!1,t(this).val())}),t("body").on("change",".cdp-modal-checkboxes .cdp-input-dynamic",function(){t('.cdp-input-dynamic[name="tooltip-which-profile-second"]').val("custom_named"),cdp_tooltips_update_content(),g(!1,"custom_named")}),t("body").on("change",".cdp-modal-input-times-tooltip",b),t("body").on("change",".cdp-modal-input-times",b),t("body").on("click",".cdp-modal-times, .cdp-modal",t.cdpModalClose),t("body").on("click",".cdp-modal-open",t.cdpModal),t("body").on("change",".cdp-profile-selected",x),t("body").on("click",".cdp-show-more-d-title",function(e){e.preventDefault(),t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-more-d-title").is(":hidden")?(t(".cdp-more-d-title").show(300),t(this).text("(hide more options)")):(t(".cdp-more-d-title").hide(300),t(this).text("(show more options)"));setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-d-first-chapter-cb",function(){t(".cdp-d-section").css({"max-height":"",height:""});let e=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")+0,o=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")+0,i=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")+0;e+o+i>1?t(".cdp-d-option-select-parent").show(300):t(".cdp-d-option-select-parent").hide(300);setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("click",".cdp-d-search",function(){let e=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")?1:0,o=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")?1:0,n=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")?1:0;e+o+n<=0?t.cdpNotification("error","Please, check for: which duplicates you are looking for"):null==c?function(e=function(){}){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_all_posts"}).done(o=>{t.isJsonString(o)&&(o=t.cdpParse(o)),e(o)}).fail(o=>{t.cdpNotification("error","Something went wrong and we couldn't get post list. – Please check console for more info."),console.log(o),e(!1)})}(t=>{0!=t&&p(t)}):p(c);function d(t,e){let o=parseInt(e[e.length-1]);for(let i=e.length;i>0&&(o=parseInt(e[i-1]),ext=!1,t.posts.findIndex(t=>t.ID==o)>=0?ext=!0:t.pages.findIndex(t=>t.ID==o)>=0?ext=!0:t.custom.findIndex(t=>t.ID==o)>=0?ext=!0:o=!1,1!=ext);--i);return o}function p(e){let o={posts:[],pages:[],custom:[]},n={},p={};null!=c&&(o=c);let h=!!t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked"),m=!!t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked"),f=!!t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked"),g=!!t('.cdp-d-option[name="cdp-d-b-title"]').is(":checked"),y=!!t('.cdp-d-option[name="cdp-d-b-slug"]').is(":checked"),v=!!t('.cdp-d-option[name="cdp-d-c-excerpt"]').is(":checked"),b=!!t('.cdp-d-option[name="cdp-d-c-count"]').is(":checked"),w=t('.cdp-d-option-select[name="cdp-d-d-sel-which"]').val(),k=null,x=null;if(h+m+f>1&&(k=t('.cdp-d-option-select[name="cdp-d-sels-diftyp"]').val()),1==g&&(x="1"==t('.cdp-d-option[name="cdp-radio-btn-dtitles"]:checked').val()),null==c)for(post_type in e)if("meta"!=post_type)for(post in e[post_type]){post=e[post_type][post],post.post_type=post.post_type[0].toUpperCase()+post.post_type.slice(1);let i=e.meta[post.ID]._cdp_origin,c=e.meta[post.ID]._cdp_counter,n=e.meta[post.ID]._cdp_origin_title,s=r(post.post_content),a={id:post.ID,url:post.guid,slug:post.post_name,type:post.post_type,date:post.post_date,title:post.post_title,status:post.post_status,edit:post.post_modified,excerpt:post.post_excerpt,words:u(s),origin:"object"==typeof i&&d(e,i),counter:"object"==typeof c&&c[c.length-1],origin_title:"object"==typeof n&&n[0]};if(l&&t.cdp.isPremium()&&(a.content=t.cdp.premium.prepareAdvanced(s),a.author=t.cdp.premium.prepareAdvanced(post.post_author)),"object"==typeof i){let t=parseInt(i[i.length-1]);void 0===p[t]?p[t]=1:p[t]++}o[post_type].push(a)}o=function(t){let e=JSON.parse(JSON.stringify(t));return e.posts.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e.pages.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e.custom.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e}(o),null==c&&(c=o);let _=[],C=[],T=!1,j=0,N=0,D=[],P=[],S=[];if("2"==k){j=1;let t=[],e=[],i=[];1==h&&(t=o.posts),1==m&&(e=o.pages),1==f&&(i=o.custom),_=(_=[].concat(t,e,i)).sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),C=M(_)}else{let t=[],e=[],i=[];1==h&&(j+=1),1==m&&(j+=1),1==f&&(j+=1),o.posts=o.posts.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==h&&(t=M(o.posts)),o.pages=o.pages.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==m&&(e=M(o.pages)),o.custom=o.custom.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==f&&(i=M(o.custom)),C=[].concat(t,e,i)}function Q(e){1==++N&&(D=e),2==N&&(P=e),3==N&&(S=e),N==j&&function(e){for(post in $tbody=t("#cdp-d-table-tbody"),$tbody.html(""),e)$tbody.append((o=e[post],t(`<tr data-id="${o.id}">\n <td><input type="checkbox" id="cdp_in_${o.id}" class="cdp-input-d-id" name="${o.id}"/></td>\n <td><label for="cdp_in_${o.id}">${o.title}</label></td>\n <td><a href="${o.url}" target="_blank">${""!=o.slug?o.slug:o.url}</a></td>\n <td>${o.type}</td>\n <td>${o.date.slice(0,-8)}</td>\n <td>${o.words}</td>\n </tr>`)));var o;if("1"==w)for(parent in n)for(child in n[parent])t(`.cdp-input-d-id[name="${n[parent][child]}"]`).prop("checked",!0);else if("2"==w)for(parent in n){t(`.cdp-input-d-id[name="${parent}"]`).prop("checked",!0);let e=Math.max(...n[parent]);for(child in n[parent])n[parent][child]!=e&&t(`.cdp-input-d-id[name="${n[parent][child]}"]`).prop("checked",!0)}else"3"==w&&t(".cdp-input-d-id").prop("checked",!0);s=n,a=w;let c=!(g||y||v||b),d=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")+0,p=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")+0,l=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")+0;c&&d+p+l>0&&e.length>0?(t("#cdp-d-table-tbody").find("tr").attr("data-ignore",!0),i.refresh(),t(".cdp-delete-info").hide(300),t('[data-empty-info="true"]').find("div").html('You did not select any filter.<br>Click <a href="#" class="cdp-show-the-copies">here</a> to show all copies (of the selected post type) made by this plugin.'),t('[data-empty-info="true"]').addClass("cdp-customized")):i.refresh();t(".cdp-d-searchbox-c").val(""),$(),0==e.length?(t.cdpNotification("warning","No posts/pages meeting the current filter conditions."),t(".cdp-delete-info").hide(300)):t(".cdp-not-yet-search").is(":visible")||(t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-not-yet-search").show(300),t('[data-empty-info="true"]').hasClass("cdp-customized")||t(".cdp-delete-info").show(300),setTimeout(()=>{t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-d-section").css({"max-height":`${t(".cdp-d-section").height()}px`})},320))}(C=[].concat(D,P,S))}function M(e){let o=[],i=[],c=!(g||y||v||b);if(!e)return o;function d(t,e){if(t.id==e.origin&&0!=e.origin_title){let t=e.origin_title.replace(/\[Counter\]/g,e.counter);if(e.title==t)return!0}return!1}function p(t){for(let e=0;e<t.length;e++){let o=t[e];if(!i.includes(o.id))for(let n=c?0:e;n<t.length;n++){if(!t[n])continue;if(i.includes(t[n].id))continue;if(n==e)continue;let p=1==g&&(o.title==t[n].title||1==x&&d(o,t[n])),a=1==y&&I(o.slug,t[n].slug)>=.85,l=!1;l=1==p||1==a?1==v&&(""==o.excerpt||o.excerpt==t[n].excerpt):1==v&&""!=o.excerpt&&o.excerpt==t[n].excerpt;let r=1==b&&o.words==t[n].words,u=1==c&&o.id==t[n].origin&&t.findIndex(e=>e.origin==t[n].id)<=-1;!p&&g||!a&&y||!l&&v||!r&&b||!u&&c||(s(o,!0,!1),s(t[n],!1,o.id))}}Q(o)}function s(t,e=!1,c=!1){i.includes(t.id)||(1==e?n[t.id]=[]:0!=c&&n[c].push(t.id),i.push(t.id),o.push(t))}l&&t.cdp.isPremium()?t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_authors"}).done(o=>{if(t.isJsonString(o)&&(o=t.cdpParse(o)),"success"===o.status){let i=o.users;p(e=t.cdp.premium.advancedfilter(e,i))}else!1===T&&(t.cdpNotification("info","Cannot connect to the server, premium filters will not be applied."),T=!0),p(e)}).fail(()=>{!1===T&&(t.cdpNotification("info","Cannot connect to the server, premium filters will not be applied."),T=!0),p(e)}):p(e)}}function r(t){return(t=(t=(t=t.replace(/\<\!\-\-(.*?)\-\-\>/gim,"")).replace(/<[^>]*>/gim," ")).replace(/\s+/gim," ")).trim()}function u(t){return(t=t.split(" ")).length}}),t("body").on("change",".cdp-input-d-id",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),o=parseInt(t(".cdp-t-d-ct").text());t(this).is(":checked")?(o++,t(this).parents("tr").addClass("cdp-del")):(o--,t(this).parents("tr").removeClass("cdp-del"));if(t(".cdp-t-d-ct").text(o),o==e)t(".cdp-d-select-all").text("Deselect all"),t(".cdp-d-checkbox-all").prop("checked",!0);else{t(".cdp-d-select-all").text("Select all");let e=t(".cdp-input-d-id:visible");for(let o=0;o<e.length;++o){if(!t(e[o]).is(":checked")){t(".cdp-d-checkbox-all").prop("checked",!1);break}o==e.length-1&&t(".cdp-d-checkbox-all").prop("checked",!0)}}}),t("body").on("change",".cdp-d-checkbox-all",function(e){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return e.preventDefault(),void t(this).prop("checked",!1);let o=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),i=t(".cdp-d-checkbox-all").is(":checked"),c=t(".cdp-input-d-id:visible"),n=0;for(let e=0;e<c.length;++e)t(c[e]).is(":checked")&&!i?n--:!t(c[e]).is(":checked")&&i&&n++,t(c[e]).prop("checked",i);let d=parseInt(t(".cdp-t-d-ct").text())+n;t(".cdp-t-d-ct").text(d),d==o?t(".cdp-d-select-all").text("Deselect all"):t(".cdp-d-select-all").text("Select all");let p=t(".cdp-input-d-id:visible").parents("tr"),s=t(".cdp-input-d-id:visible:checked").parents("tr");p.removeClass("cdp-del"),s.addClass("cdp-del")}),t("body").on("click",".cdp-d-select-all",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),o=parseInt(t(".cdp-t-d-ct").text()),i=!0;e==o&&(i=!1);$chbs=t(".cdp-input-d-id");for(let e=0;e<$chbs.length;++e)t($chbs[e]).prop("checked",i);t(".cdp-t-d-ct").text(1==i?e:"0"),0==i?(t(".cdp-d-select-all").text("Select all"),t(".cdp-d-checkbox-all").prop("checked",!1),t(".cdp-input-d-id").parents("tr").removeClass("cdp-del")):(t(".cdp-d-checkbox-all").prop("checked",!0),t(".cdp-d-select-all").text("Deselect all"),t(".cdp-input-d-id").parents("tr").addClass("cdp-del"))}),t("body").on("click",".prev_page, .next_page, .page_link",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;t(".cdp-input-d-id:visible:checked").length==t(".cdp-input-d-id:visible").length?t(".cdp-d-checkbox-all").prop("checked",!0):t(".cdp-d-checkbox-all").prop("checked",!1)}),t("body").on("click",".cdp-d-real-delete",function e(o=!1,n=null,d=0){if(!t(".cdp-d-just-check-it").is(":checked"))return void t.cdpNotification("warning","Please check that you completed all steps, before this task!");let p=[];if(null===n){let e=t(".cdp-input-d-id:checked");for(let o=0;o<e.length;++o)p.push(parseInt(t(e[o]).attr("name")));if(0==p.length)return void t.cdpNotification("warning","Nothing to do here, please select at least one post to delete.")}else p=n;let u=t(".cdp-d-throttling").val(),h=t(".cdp-d-throttling-count").val(),m=t(".cdp-p-redirections").val(),f=!!t(".cdp-p-just-trash-them").is(":checked"),g=null,y="1"==t('.cdp-dis-en-opt[name="cdp-redirections"]').val();if("1"==u&&(!h||0==h||""==h))return void t.cdpNotification("warning","You have wrong count in throttling field, please fix.");l&&t.cdp.isPremium()&&(g=t.cdp.premium.auitd(a,s));if(p.length>801&&!0!==o){let t=Math.ceil(p.length/800);for(let o=0,i=!0;o<t;++o)o==t-1&&(i=!1),e(i,p.slice(800*o,800*o+800),o);return}t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"delete_them",ids:p,throttling:u,thc:h,redi:m,thrs:f,auit:y,auitd:g}).done(e=>{if(t.isJsonString(e)&&(e=t.cdpParse(e)),"success"==e.status){t("#cdp-d-table-tbody").find(".cdp-del").remove();let e=c.posts.filter(t=>!p.includes(t.id)),n=c.pages.filter(t=>!p.includes(t.id)),s=c.custom.filter(t=>!p.includes(t.id));c={posts:e,pages:n,custom:s},!0!==o&&i.refresh(),$(),0==d&&t.cdpNotification("success","Deletion process started, you can close this page now and wait till the process ends!"),_(C),!0!==o&&($parent=t(".cdp-d-section").parents(".cdp-collapsible"),$col=t(t($parent[0]).find(".cdp-collapsible-title")[0]),r("true",$col))}else!0!==o&&t.cdpNotification("error",`Something went wrong and we couldn't setup the deletion task. ${"1"==u?"– Please try without throttling.":""}`)}).fail(e=>{!0!==o&&t.cdpNotification("error","Something went wrong and we couldn't setup the deletion task. – Please check console for more info."),console.log(e)})}),t("body").on("change",".cdp-d-throttling",function(){t(".cdp-d-section").css({"max-height":"",height:""}),"1"==t(this).val()?t(".cdp-d-throttling-count-p, .cdp-even-more-th-info").show(300):t(".cdp-d-throttling-count-p, .cdp-even-more-th-info").hide(300);setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-d-throttling-count",function(){let e=parseInt(t(this).val());isNaN(e)?t(this).val(1):e>=1&&e<=10240?e>=1&&e<=1&&t(this).val(1):e<1?t(this).val(1):t(this).val(10240)}),t("body").on("change",".cdp-custom-date-picking",u),t("body").on("mouseover",".cdp-tooltip-copy",function(){t(this).hasClass("tooltipstered")||(t(this).tooltipster({delay:100,timer:400,debug:!1,delayTouch:[100,200],interactive:!0,distance:4,side:"bottom",contentAsHTML:!0,content:t(".cdp-tooltip-content").html(),repositionOnScroll:!0,selfDestruction:!1,trigger:"custom",triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{mouseleave:!0,click:!0,tap:!0},functionBefore:Q,functionReady:M,functionAfter:A,functionFormat:O}),t(this).tooltipster("open"),t("#cdp-hideTT").length>0&&t(".tooltipster-base").hide())}),t("body").on("keyup",".cdp-d-searchbox-c",function(){if(t('[data-empty-info="true"].cdp-customized').length>0)return;let e=t(this).val();e.length>100&&(e=e.substr(0,100));if(e=(e=e.trim().replace(/\s+/gim," ").toLowerCase()).split(" "),$trs=t("#cdp-d-table-tbody").find("tr"),$trs.length<=0)return;$trs.removeAttr("data-ignore");for(let o=0;o<$trs.length;++o){$tr=t($trs[o]),$title=t($tr.find("td")[1]).text().toLowerCase(),$url=t($tr.find("td")[2]).text().toLowerCase();let i=!1;for(let t=0;t<e.length;++t)if($title.includes(e[t]))i=!0;else{if(!$url.includes(e[t])){i=!1;break}i=!0}0==i&&$tr.attr("data-ignore","true")}clearTimeout(p),p=setTimeout(()=>{i.refresh()},20)}),t("body").on("change",".cdp-data-set",T),t("#wpbody").on("scroll",j),t(window).on("scroll",j),t("body").on("click",".nice-select",j),t("body").on("click",".cdp-show-the-copies",function(e){e.preventDefault(),t(".cdp-d-section").css({"max-height":"",height:""}),t("#cdp-d-table-tbody").find("tr").not('[data-empty-info="true"]').removeAttr("data-ignore"),t(".cdp-d-searchbox-c").val(""),t('[data-empty-info="true"]').addClass("cdp-customized"),i.refresh(),$(),t(".cdp-d-section").css({"max-height":"",height:""}),parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text())>0&&t(".cdp-delete-info").show(300);t(".cdp-not-yet-search").is(":visible")||(t(".cdp-not-yet-search").show(300),t('[data-empty-info="true"]').hasClass("cdp-customized")||t(".cdp-delete-info").show(300));setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-per-page-select-show",function(){let e=t(this).val();i.changePageSize(e)}),t("body").on("change",'.cdp-d-option[name="cdp-d-b-title"]',N),t("body").on("change",'.cdp-d-option[name="cdp-d-b-slug"]',N),t("body").on("click",".cdp-tab-element",function(){if(t(this).hasClass("cdp-tab-active"))return;if("true"==t(this).attr("data-disabled"))return;let e=t(t(`#${t(this).attr("data-box")}`)[0]),o=t(t(`#${t(".cdp-tab-active").attr("data-box")}`)[0]);if(!e||e.length<=0)return;t(".cdp-tab-active").removeClass("cdp-tab-active"),t(this).addClass("cdp-tab-active"),e.show(),e.css({"max-height":"",height:""});let i=e.height();e.css({"max-height":"0px",opacity:0}),e.animate({"max-height":i+"px",opacity:1},500,function(){let e=t(".cdp-d-section").height();t(".cdp-d-section").css({height:e+"px","max-height":e+"px"})}),t(".cdp-d-section").css({height:"","max-height":""}),o.css({"max-height":o.height()+"px",opacity:1}),o.animate({"max-height":"0px",opacity:0},500,function(){o.hide()}),setTimeout(()=>{o.css({"max-height":"",height:""}),e.css({"max-height":"",height:""})},510);let c=parseInt(t(window).height()/8);t("#wpbody").animate({scrollTop:jQuery(".cdp-d-section")[0].offsetTop-c},500)}),t("body").on("click",".cdp-premium-element",function(t){t.preventDefault()}),t("body").on("click",".cdp-go-to-names-chapter",function(e){e.preventDefault(),z(),r("cdp-name-section-cnx"),setTimeout(()=>{let e=parseInt(t(window).height()/4);t("#wpbody").animate({scrollTop:t(".cdp-name-section-cnx")[0].offsetTop-e},500)},400)}),t("body").on("click",".cdp-close-chapter",D),t("body").on("click",".cdp-save-options",D),t("body").on("click",".cdp-togglable-name-b",function(){"(Name of original)"==t(".cdp-togglable-name-b").text()?(t(".cdp-togglable-name-b").text("(blank)"),t(".cdp-togglable-name-b").tooltipster("content","Change it to (Name of original)")):(t(".cdp-togglable-name-b").text("(Name of original)"),t(".cdp-togglable-name-b").tooltipster("content","Change it to blank"));u()}),t("#cdp_jvlabelWrap-fake").on("click",function(){if(0===t("#support-cdp").length){t(t(".cdp-container")[0]).append('<script id="support-cdp" src="//code.jivosite.com/widget/MoP3Jphzts" async><\/script>'),setTimeout(function(){t("#cdp_jvlabelWrap-fake").hide()},100);var e=!1;let o=setInterval(function(){1==e&&clearInterval(o),void 0!==window.jivo_api&&(window.jivo_api.open(),e=!0)},30)}}),t(".cdp-select").niceSelect(),t(".cdp-tooltip").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:4,side:"top",contentAsHTML:!0,maxWidth:600,triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{mouseleave:!0,click:!0,tap:!0},theme:["tooltipster-noir","tooltipster-noir-customized"],repositionOnScroll:!0,functionReady:L}),t("#cdp-d-table").length>0&&(i=new IcPagination(t("#cdp-d-table"),"#cdp-d-table-pagi",{itemsOnPage:25,useParams:!1,emptylist:'<div class="cdp-center">No items to show, try with other filters!</div>'})),t(".cdp-copy-button").on("mouseup",function(){f(!0)});let P=(e,o,i,c)=>t(`<a class="ab-item cdp-dropdown-menu cdp-dd-item cdp-dd-ud${0==e?" cdp-bnew-notis":""}" data-token="${o}">\n <div style="display: block; width: calc(100% - 3px);">\n <div class="cdp-dropdown-left${1==i?" cdp-red":""}">${"delete"==c?"Deleting Posts":"Auto Cleaning-up"}</div>\n <div class="cdp-dropdown-right cdp-noti-kill-btn">Kill</div>\n </div>\n </a>`),S=(e,o,i,c)=>{let n="",d="";return void 0!==e&&(void 0!==e["formated-date"]&&(n=e["formated-date"]),void 0!==e.text&&(d=e.text),""!=d&&(d='data-ftext="'+d+'" '),""!=n&&(n='data-fdate="Completed at '+n+'" ')),t(`<a ${n}${d}class="ab-item cdp-dropdown-menu cdp-dd-item cdp-dd-d${0==o?" cdp-bnew-notis":""}" data-token="${i}">\n <div style="display: block; width: calc(100% - 3px);">\n <div class="cdp-dropdown-left">${"delete"==c?"Deleted Posts":"Auto Cleaned-up"}</div>\n <div class="cdp-dropdown-right cdp-noti-hide-btn">Hide</div>\n </div>\n </a>`)};function I(t,e){let o=t,i=e;t.length<e.length&&(o=e,i=t);let c=o.length;return 0==c?1:(c-function(t,e){t=t.toLowerCase(),e=e.toLowerCase();let o=new Array;for(let i=0;i<=t.length;i++){let c=i;for(let n=0;n<=e.length;n++)if(0==i)o[n]=n;else if(n>0){let d=o[n-1];t.charAt(i-1)!=e.charAt(n-1)&&(d=Math.min(Math.min(d,c),o[n])+1),o[n-1]=c,c=d}i>0&&(o[e.length]=c)}return o[e.length]}(o,i))/parseFloat(c)}function Q(o,i){z(!0),t(".cdp-tooltip-before-options").show(),t(".cdp-tooltip-full-options").hide(),$inputs=t(t(".cdp-tooltip-content").find("input, select"));for(let e=0;e<$inputs.length;++e){let o=t($inputs[e]);if("checkbox"==o.attr("type"))o.is(":checked")?o.attr("checked","checked"):o.removeAttr("checked");else if(t(o).is("select"))if("tooltip-which-profile-first"==t(o).attr("name")){let e=t(t('[name="tooltip-which-profile-first"]')[0]).val();"custom"==e||null==e?setTimeout(()=>{t('[name="tooltip-which-profile-first"]').val("custom")},50):setTimeout(()=>{t('[name="tooltip-which-profile-first"]').val(e)},50)}else{let e=t('[name="tooltip-which-profile-second"] option:selected').map(function(t,e){return this.value}).get()[0];"custom"==e||null==e?setTimeout(()=>{t('[name="tooltip-which-profile-second"]').val("custom")},50):setTimeout(()=>{t('[name="tooltip-which-profile-second"]').val(e)},50)}else o.attr("value",o.val())}return cdp_tooltips_update_content(),e=t(i.origin).attr("data-cdp-id"),!0}function M(e,o){$parent=t(o.origin).parents(".row-actions"),$parent.css({left:0});let i=t(t("a.menu-top.toplevel_page_copy-delete-posts")[0]).attr("href");t(".cdp-tooltip-info-intt").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:6,side:"top",contentAsHTML:!0,content:`Define your copy settings <a href="${i}">here</a>.`,maxWidth:400,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-center"],repositionOnScroll:!0}),l&&jQuery.cdp.isPremium()?t(".cdp-tooltip-premium-spc-3").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:"If you’re on a multisite you can copy it to other sites.",contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}):(t(".cdp-tooltip-premium-spc-2").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'If you’re on a multisite you can copy it to other sites with the Premium Plugin. <a href="https://sellcodes.com/CylMIdJD" target="_blank">Order it now!</a>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t(".cdp-tooltip-premium-spc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This is a Premium Feature.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Check it out and upgrade today</a>,<br>we made it <b>really affordable!</b>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").addClass("cdp-premium-element"),t(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").find("input, select").prop("disabled",!0),t(".cdp-tooltip-premium-spc-4").tooltipster("content",'You can copy it to other sites with the Premium Plugin.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>'),L(),cdp_tooltips_update_content())}function A(e,o){return $parent=t(o.origin).parents(".row-actions"),$parent.css({left:""}),!1}function O(){return t(t(".cdp-tooltip-content").html())}function L(){setTimeout(()=>{let e=t.tooltipster.instances();for(instance in e)e[instance].reposition()},10)}function z(e=!1){if(e){let e=t.tooltipster.instances();for(instance in e)e[instance].close()}else setTimeout(()=>{let e=t.tooltipster.instances();for(instance in e)e[instance].close()},10)}if(t(".cdp-admin-bar-noti").length>0&&setInterval(()=>{_(t=>{C(t)})},7e3),t(".cdp-drag-name").draggable({containment:".cdp-drags-cont",scroll:!1,helper:"clone",revert:"invalid"}),t(".cdp-names-real-input").droppable({drop:function(e,o){$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],t(this).html(`${t(this).html()}${$picks[t(o.helper).attr("data-cdp-val")]}`),u()}}),"undefined"!=typeof pagenow&&["edit-page","edit-post"].includes(pagenow)&&t(".column-cb, .check-column").find("input").prop("checked",!1),t("#titlediv").find(".inside").length>0&&t("#cdp-original-post").length>0){let e=t("#cdp-original-post").attr("data-cdp-parent"),o=t("#cdp-original-post").attr("data-cdp-parent-url");t("#titlediv").find(".inside").append(t(`<div style="padding-left: 10px">This post is a duplicate of <a href="${o}" target="_blank">${e}</a></div>`))}t(".cdp-preloader-c").length>0&&(u(),m(),x(),setTimeout(()=>{h(".cdp-names-prefix"),h(".cdp-names-suffix")},1e3),function(){let e=t(".cdp-tab-active");for(let o=0;o<e.length;o++){let i=t(`#${t(e[o]).attr("data-box")}`);i.show(),i.css({"max-height":"",height:""});let c=i.height();t(c).css({"max-height":c+"px",height:c+"px"})}}()),setTimeout(()=>{t(".cdp-container").is(":hidden")&&setTimeout(()=>{jQuery(".cdp-preloader-c").hide(),jQuery(".cdp-container").css({opacity:0}),jQuery(".cdp-container").show(),jQuery("#wpfooter").show(300),jQuery(".cdp-container").animate({opacity:1},300)},400)},5e3)}),jQuery(window).on("load",function(){setTimeout(()=>{jQuery(".cdp-preloader-c").hide(),jQuery(".cdp-container").css({opacity:0}),jQuery(".cdp-container").show(),jQuery("#wpfooter").show(300),jQuery(".cdp-container").animate({opacity:1},300);const t=void 0!==jQuery.cdp&&void 0!==jQuery.cdp.isPremium;jQuery(".cdp-tooltip-premium-dc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This is a Premium Feature.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Check it out and upgrade today</a>,<br>we made it <b>really affordable!</b>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t&&jQuery.cdp.isPremium()?(jQuery(".cdp-tooltip-premium-spc-3").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:"If you’re on a multisite you can copy it to other sites.",contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),jQuery(".cdp-tooltip-premium-spc-3").addClass("cdp-premium-element"),jQuery(".cdp-tooltip-premium-spc-3").find("input, select").prop("disabled",!0)):(jQuery('.cdp-option-premium [value="3"]').prop("disabled",!0),setTimeout(()=>{jQuery(".cdp-premium-in-select").find('.option[data-value="premium"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-option-premium").find('.option[data-value="3"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-tooltip-premium-spc-2").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'If you’re on a multisite you can copy it to other sites with the Premium Plugin. <a href="https://sellcodes.com/CylMIdJD" target="_blank">Order it now!</a>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),jQuery(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").addClass("cdp-premium-element"),jQuery(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").find("input, select").prop("disabled",!0),jQuery(".cdp-tooltip-premium-spc-4").tooltipster("content",'You can copy it to other sites with the Premium Plugin.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>'),function(t){let e=void 0!==t?t:".cdp-tooltip-premium",o=-15;isNaN(parseInt(jQuery(e).attr("data-top")))||(o=parseInt(jQuery(e).attr("data-top")));jQuery(e).tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:o,side:"top",content:'This is a Premium Feature.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Check it out and upgrade today</a>,<br>we made it <b>really affordable!</b>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),i=e,jQuery(i).addClass("cdp-premium-element"),jQuery(i).find("input, select").prop("disabled",!0);var i}(),cdp_tooltips_update_content()},1e3))},400)}),function(t){function e(t,e){if(!(t.originalEvent.touches.length>1)){t.preventDefault();let o=t.originalEvent.changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent(e,!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(i)}}if(t.support.touch="ontouchend"in document,t.support.touch){let o,i=t.ui.mouse.prototype,c=i._mouseInit,n=i._mouseDestroy;i._touchStart=function(t){!o&&this._mouseCapture(t.originalEvent.changedTouches[0])&&(o=!0,this._touchMoved=!1,e(t,"mouseover"),e(t,"mousemove"),e(t,"mousedown"))},i._touchMove=function(t){o&&(this._touchMoved=!0,e(t,"mousemove"))},i._touchEnd=function(t){o&&(e(t,"mouseup"),e(t,"mouseout"),this._touchMoved||e(t,"click"),o=!1)},i._mouseInit=function(){let e=this;e.element.bind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),c.call(e)},i._mouseDestroy=function(){let e=this;e.element.unbind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),n.call(e)}}}(jQuery);
1
+ function cdp_tooltips_update_content(){if(jQuery("select").niceSelect("update"),!(void 0!==jQuery.cdp&&void 0!==jQuery.cdp.isPremium)||!jQuery.cdp.isPremium()){jQuery(".cdp-premium-in-select").find('.option[data-value="premium"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-option-premium").find('.option[data-value="3"]').addClass("cdp-tooltip-premium disabled"),$prems=jQuery(".cdp-tooltip-premium");for(let t=0;t<$prems.length;t++){let e=$prems[t],o=-15;isNaN(parseInt(jQuery(e).attr("data-top")))||(o=parseInt(jQuery(e).attr("data-top"))),jQuery(e).tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:o,side:"top",content:'This is a Premium Feature.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Check it out and upgrade today</a>,<br>we made it <b>really affordable!</b>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0})}jQuery(".cdp-tooltip-premium-dc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This is a Premium Feature.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Check it out and upgrade today</a>,<br>we made it <b>really affordable!</b>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0})}}function cdp_totally_know_what_i_am_doing(t){if("really"!=t)return"Are you REALLY sure?";console.log("You're crazy! – Here is the output:");let e=jQuery;e("#cdp-purl").val();e.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"debug_function"}).done(t=>{console.log(t),console.log("–––––––––––––- END OF THE DEBUG OUTPUT –––––––––––––- ")})}jQuery(document).ready(function(t){t("#cdp-purl").val();let e=null,o="default",i=null,c=null,n=null,d=null,p=null,s=null,a=null;const l=void 0!==t.cdp&&void 0!==t.cdp.isPremium;function r(e=null,o=!1){let i=this;"string"==typeof e&&(i=`.${e}`),0!=o&&(i=o),$parent=t(t(i).parents(".cdp-collapsible")[0]),$arrow=$parent.find(".cdp-arrow"),$body=$parent.find(".cdp-collapsible-content"),$title=$parent.find(".cdp-collapsible-title"),$titles=t(".cdp-collapsible-title"),group=$parent.attr("data-cdp-group"),height=$body.prop("scrollHeight"),$oArrows=t(`.cdp-collapsible[data-cdp-group="${group}"]`).not($parent).find(".cdp-arrow"),$oBodies=t(`.cdp-collapsible[data-cdp-group="${group}"]`).not($parent).find(".cdp-collapsible-content"),$body.hasClass("cdp-active")?($body.removeClass("cdp-active"),$titles.removeClass("cdp-active"),$oBodies.removeClass("cdp-active"),$arrow.removeClass("cdp-arrow-down").addClass("cdp-arrow-left"),$body.css({"max-height":""})):($titles.removeClass("cdp-active"),$body.addClass("cdp-active"),$title.addClass("cdp-active"),$oBodies.removeClass("cdp-active"),$arrow.removeClass("cdp-arrow-left").addClass("cdp-arrow-down"),$oArrows.removeClass("cdp-arrow-down").addClass("cdp-arrow-left"),$body.css({"max-height":`${height+30}px`}),$oBodies.css({"max-height":""}))}function u(){let e=t(".cdp-names-prefix").text(),o=t(".cdp-names-suffix").text(),i={year:(c=new Date).getFullYear(),month:("0"+(c.getMonth()+1)).slice(-2),day:c.getDate()<=9?"0"+c.getDate():c.getDate(),hour:c.getHours()<=9?"0"+c.getHours():c.getHours(),minute:c.getMinutes()<=9?"0"+c.getMinutes():c.getMinutes(),second:c.getSeconds()<=9?"0"+c.getSeconds():c.getSeconds(),week:c.getDay()};var c;let n="(blank)"==t(".cdp-togglable-name-b").text()?"":"(Name of original)",d=`${e.trim()} ${n} ${o.trim()}`;d=d.replace(/\[Counter\]/g,"2");let p=t(".cdp-date-picked").val();"1"==p?d=d.replace(/\[CurrentDate\]/g,`${i.month}/${i.day}/${i.year}`):"2"==p?d=d.replace(/\[CurrentDate\]/g,`${i.day}/${i.month}/${i.year}`):"3"==p&&function(e){let o=t(".cdp-custom-date-picking").val();t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_formatted_time",format:o}).done(t=>{e(t)}).fail(()=>{e(!1)})}(e=>{d=d.replace(/\[CurrentDate\]/g,`${e}`),t(".cdp-example-name").text(d),d=(d=d.replace(/\[CurrentTime\]/g,`${i.hour}:${i.minute}:${i.second}`)).replace(/\s+/gim," "),t(".cdp-example-name").text(d)}),"3"!=p&&(d=(d=d.replace(/\[CurrentTime\]/g,`${i.hour}:${i.minute}:${i.second}`)).replace(/\s+/gim," "),t(".cdp-example-name").text(d))}function h(e=""){before=t(e).html(),text=t(e).html(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],text=text.replace(/\[Counter\]/g,$picks[0]),text=text.replace(/\[CurrentDate\]/g,$picks[2]),text=text.replace(/\[CurrentTime\]/g,$picks[1]),text!=before&&t(e).html(text)}function m(){val=t('.cdp-other-options[name="after_copy"]').val(),2==val?t(".cdp-if-edit-page-selected").show(300):t(".cdp-if-edit-page-selected").is(":hidden")||t(".cdp-if-edit-page-selected").hide(300),setTimeout(()=>{jQuery(".cdp-oth-section").css({"max-height":""}),jQuery(".cdp-oth-section").css({"max-height":jQuery(".cdp-oth-section").height()})},310)}function f(i=!1){let c=t(this).attr("data-cdp-btn");1==i&&(c="copy-quick");let n=["copy-quick","copy-custom","copy-custom-link"],d=t(".cdp-modal-checkboxes").find(".cdp-input-dynamic");if(n.includes(c)){let i={type:c};if(c==n[0]){if(i.times=t(".cdp-modal-input-times-tooltip").val(),i.site=t('.cdp-input-dynamic[name="tooltip-which-site-first"]').val(),i.profile=t('.cdp-input-dynamic[name="tooltip-which-profile-first"]').val(),i.swap="2"==t(".cdp-swap").val()?"true":"false",!i.profile||"custom"==i.profile)return t.cdpNotification("warning","Please select settings for this copy."),void w()}else if(c==n[1]||c==n[2]){i.times=t('.cdp-modal-input-times[name="tooltip-which-times-second"]').val(),i.site=t('.cdp-input-dynamic[name="tooltip-which-site-second"]').val(),i.profile=t('.cdp-input-dynamic[name="tooltip-which-profile-second"]').val(),i.swap="2"==t(".cdp-swap").val()?"true":"false",i.custom={};for(let e=0;e<d.length;++e)i.custom[t(d[e]).attr("name")]=t(d[e]).is(":checked")}if(isNaN(parseInt(i.times))||parseInt(i.times)<=0)return void t.cdpNotification("warning","You need to insert positive number for copies.");i.profile&&!["custom","clear","custom_named"].includes(i.profile)||(i.profile=o),z(),function(e=(()=>{})){window.onbeforeunload=(()=>"Copy in progress..."),$e=t(".cdp-copy-loader-overlay"),$e.is(":hidden")&&($e.show(),$e.animate({opacity:1},300,function(){e(!0)}))}(()=>{t.ajax({type:"POST",url:ajaxurl,data:{action:"cdp_action_handling",token:"cdp",f:"copy_post",origin:"tooltip",id:[e],data:i},timeout:0}).done(function(e){w(),t.isJsonString(e)&&(e=t.cdpParse(e)),"error"==e.status?t.cdpNotification("error","Something went wrong and we couldn't copy this post – please try again!"):c==n[2]||void 0!==e.link&&e.link.length>0?"pConv"==e.link?(t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"delete_success_img"}),"-28"==t(".cdp-copy-alert-success").position().top&&t(".cdp-copy-alert-success").animate({top:"32px",opacity:1},300),setTimeout(()=>{"32"==t(".cdp-copy-alert-success").position().top&&t(".cdp-copy-alert-success").animate({top:"-28px",opacity:0},300)},3e3)):window.location.href=e.link:location.reload()}).fail(function(e){t.cdpNotification("error","Something went wrong and we couldn't copy this post. – See dev console for more info."),w(),console.log(e),console.log(e.responseText)})})}else t.cdpNotification("Couldn't recognize that button, please try again.")}function g(e,i=!1){let c=t('.cdp-input-dynamic[name="tooltip-which-profile-second"]'),n=t(".cdp-modal-checkboxes").find(".cdp-input-dynamic"),d=c.length>1?t(t(c[1])):t(t(c[0]));t(c[1])&&t(c[1])||(null==t(c[1])&&t(c[0])?d=t(t(c[0])):null==t(c[0])&&t(c[1])&&(d=t(t(c[1]))));let p=d.val();0==e&&(p=i),"custom_named"==p?c.val("custom_named"):"custom"==p||null==p||null==p?c.val("custom"):"clear"==p?(0!=e&&e.preventDefault(),n.prop("checked",!1),c.val("custom")):!["clear","custom","custom_named"].includes(p)&&p.length>=1?v(p,function(e){for(let o in e)"object"!=typeof o&&t(`.cdp-input-dynamic[name="${o}"]`).prop("checked",y(e[o]))}):(0!=e&&e.preventDefault(),t.cdpNotification("warning","Unable to recognize selected profile, please try again.")),0==e&&c.val(p),["clear","custom","custom_named"].includes(p)||(o=p),cdp_tooltips_update_content()}function y(t){return"string"==typeof t&&"true"==t.trim().toLowerCase()}function v(e="default",o){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_settings",profile:e}).done(e=>{if(t.isJsonString(e)&&(e=t.cdpParse(e)),e.status&&"error_no_exists"==e.status){t.cdpNotification("warning","Profile you selected is just empty, please update this profile or use custom settings!");let e={},i=t(".cdp-modal-option-r");for(let o=0;o<i.length;o++)e[t(i[o]).attr("name")]=t(i[o]).is(":checked");o(!1)}else o(e)}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't get profile settings. – Check console for more details"),console.log("Copy & Delete Post – Error"),console.log(e),console.log("––––––––––––––––––––––––––"),o(!1)})}function b(){t(this).attr("class");let e=parseInt(t(this).val());e<=0&&(e=1),e>9999&&(e=9999),isNaN(e)&&(e=1),e||(e=1),t(".cdp-modal-input-times").val(e),t(".cdp-modal-input-times-tooltip").val(e),e>50?(t(".cdp-error-span-tooltip").show(300),t(".cdp-tooltip-before").attr("style","height: calc(225px - 20px - 16px) !important")):(t(".cdp-error-span-tooltip").hide(300),t(".cdp-tooltip-before").attr("style","")),e>1?(t(".cdp-multiple-tooltip-count").animate({opacity:1},200),t('.cdp-tooltip-btn-copy[data-cdp-btn="copy-custom-link"]').hide()):(t(".cdp-multiple-tooltip-count").animate({opacity:0},200),t('.cdp-tooltip-btn-copy[data-cdp-btn="copy-custom-link"]').show()),setTimeout(()=>{L()},310)}function w(e=(()=>{})){window.onbeforeunload=null,$e=t(".cdp-copy-loader-overlay"),$e.is(":hidden")||$e.animate({opacity:0},300,function(){$e.hide(),e(!0)})}function x(){let e=t(".cdp-profile-selected").val();var o,i;v(e,c=>{if(t.isJsonString(c)||"object"==typeof c){"object"!=typeof c&&(c=JSON.parse(c));let n=["usmplugin","yoast","woo"];for(k in c)"names"==k?(t(".cdp-names-prefix").html(c[k].prefix),t(".cdp-names-suffix").html(c[k].suffix),"3"!=c[k].format||l||(c[k].format="1"),t(".cdp-date-picked").val(c[k].format),t(".cdp-custom-date-picking").val(c[k].custom)):(!n.includes(k)||n.includes(k)&&l&&t.cdp.isPremium())&&t(`.cdp-data-set[data-cdp-opt="${k}"]`).prop("checked","true"==c[k]);cdp_tooltips_update_content(),u(),m(),l&&t.cdp.isPremium()&&t.cdp.premium.detectChangeOfCustom(),T(),h(".cdp-names-prefix"),h(".cdp-names-suffix"),o=e,i=(()=>{}),t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"set_default_profile",selection:o}).done(t=>{i(t)}).fail(()=>{i(!1)})}else t.cdpNotification("warning","There was an error while getting data from server, please try again.")})}function $(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=t(".cdp-input-d-id").length,o=t(".cdp-input-d-id:checked").length;o==e?t(".cdp-d-select-all").text("Deselect all"):t(".cdp-d-select-all").text("Select all"),t(".cdp-t-d-ct").text(o),$visible=t(".cdp-input-d-id:visible").length,$visible_checked=t(".cdp-input-d-id:checked:visible").length,$visible==$visible_checked?t(".cdp-d-checkbox-all").prop("checked",!0):t(".cdp-d-checkbox-all").prop("checked",!1),function(){let e=t(".cdp-input-d-id").parents("tr"),o=t(".cdp-input-d-id:checked").parents("tr");e.removeClass("cdp-del"),o.addClass("cdp-del")}()}function _(e){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"give_me_current_tasks"}).done(o=>{t.isJsonString(o)&&(o=t.cdpParse(o)),"success"==o.status&&e(o.tasks)})}function C(e){let o=0,i=+new Date/1e3,c=t(".cdp-dd-item");for(let i=0;i<c.length;++i){e[t(c[i]).attr("data-token")]||t(c[i]).remove(),o++}for(task in e){let c=e[task],n=t(t(`.cdp-dd-item[data-token="${task}"]`)[0]);if(0==c.done){if(n.hasClass("cdp-dd-ud"))continue;{n.remove();let e=i-c.done>=86400;t(".cdp-dd-undone-list").append(P(c.shown,task,e,c.f)),o++}}else{if(n.hasClass("cdp-dd-d"))continue;n.remove(),t(".cdp-dd-done-list").append(S(c.data,c.shown,task,c.f)),o++}}(o>0||0==c.length)&&function(){let e=t(".cdp-dd-item").length,o=t(".cdp-dd-d").length,i=t(".cdp-dd-ud").length;o<=0?(t(".cdp-done-notis, .cdp-done-notis").addClass("cdp-noti-hide"),t(".cdp-done-hr, .cdp-done-notis").hide()):(t(".cdp-done-notis, .cdp-done-notis").removeClass("cdp-noti-hide"),t(".cdp-done-hr, .cdp-done-notis").show()),i<=0?(t(".cdp-undone-notis, .cdp-undone-notis").addClass("cdp-noti-hide"),t(".cdp-undone-hr, .cdp-undone-notis").hide()):(t(".cdp-undone-notis, .cdp-undone-notis").removeClass("cdp-noti-hide"),t(".cdp-undone-hr, .cdp-undone-notis").show()),e<=0?t(".cdp-admin-bar-noti").addClass("cdp-noti-hide"):t(".cdp-admin-bar-noti").removeClass("cdp-noti-hide"),t(".cdp-notis-counter").text(t(".cdp-bnew-notis").length)}()}function T(){$trs=t(".cdp-table tbody.cdp-ff-b1").find("tr");for(let e=0;e<$trs.length;e++){let o=t($trs[e]);o.find("input").is(":checked")?o.addClass("cdp-selected-tr-opt"):o.removeClass("cdp-selected-tr-opt")}}function j(e){if(t(".cdp-modal").is(":visible"))return;let o=window;0!=t("#wpbody").scrollTop()&&(o="#wpbody");let i=t(o).scrollTop()+2;i<=0&&(i=2),"click"!=e.type&&t(".nice-select, .nice-select .list").css({transition:"all 0s"}),t(".nice-select .list").css({"margin-top":`${-i}px`}),t("#cdpp-af-author").length>0&&(t(".ui-autocomplete").css({top:`${t("#cdpp-af-author").offset().top+40}px`}),t(".cdp-cool-datepicker").css({top:`${t(".cdpp-input-a").offset().top+40}px`})),clearTimeout(d),d=setTimeout(()=>{t(".nice-select .list").css({transition:""})},100),clearTimeout(n),n=setTimeout(()=>{let i=t(o).scrollTop()+2;i<=0&&(i=2),"click"!=e.type&&t(".nice-select .list").css({transition:"all 0s !important"}),t(".nice-select .list").css({"margin-top":`${-i}px`}),t("#cdpp-af-author").length>0&&(t(".ui-autocomplete").css({top:`${t("#cdpp-af-author").offset().top+40}px`}),t(".cdp-cool-datepicker").css({top:`${t(".cdpp-input-a").offset().top+40}px`})),clearTimeout(d),d=setTimeout(()=>{t(".nice-select .list").css({transition:""})},100)},100)}function N(){let e=t('.cdp-d-option[name="cdp-d-b-title"]').is(":checked"),o=t('.cdp-d-option[name="cdp-d-b-slug"]').is(":checked");e||o?t(".cdp-no-empty-text").html("<b>including</b> empty"):t(".cdp-no-empty-text").html("only if <u><b>not</b></u> empty")}function D(e){e.preventDefault(),$parent=t(this).parents(".cdp-collapsible"),$col=t(t($parent[0]).find(".cdp-collapsible-title")[0]),r("true",$col)}t(".cdp-intro-button").on("click",function(){let e=t(".cdp-intro").height();t(".cdp-intro").css({height:e+"px"}),t(".cdp-intro").animate({opacity:0,height:0},300,function(){t(".cdp-intro").hide(10),t("#cdp-never-intro").is(":checked")&&t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"no_intro"}).done(e=>{"error"==e&&t.cdpNotification("error","Something went wrong and we couldn't save intro settings!")}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't save intro settings.")})}),t(".cdp-s-i-a").show(),t(".cdp-s-i-a").animate({opacity:1},300)}),t(".cdp-save-options").on("click",function(){let e=t(".cdp-data-set"),o=t(".cdp-other-inputs"),i=t(".cdp-profile-selected").val(),c=t(".cdp-names-prefix").text().replace(/\s+/g," ").trim(),n=t(".cdp-names-suffix").text().replace(/\s+/g," ").trim(),d={names:{prefix:c,suffix:n,format:t(".cdp-date-picked").val(),custom:t(".cdp-custom-date-picking").val(),display:t(t(`option[value="${t(".cdp-profile-selected").val()}"]`)[0]).text()}},p={afterCopy:t('.cdp-other-options[name="after_copy"]').val(),postConverter:t('.cdp-other-options[name="post_converter"]').val(),others:{}},s={},a=t(".cdp-other-roles");for(let e=0;e<a.length;e++)s[t(a[e]).attr("name")]=t(a[e]).is(":checked");p.roles=s;for(let o=0;o<e.length;o++)d[t(e[o]).attr("data-cdp-opt")]=!!t(e[o]).is(":checked");for(let e=0;e<o.length;e++)p.others[t(o[e]).attr("name")]=!!t(o[e]).is(":checked");t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"save_options",options:d,profile:i,entire:p}).done(e=>{"success"==e?t.cdpNotification("success","All your settings were saved!",2e3):"error"==e?t.cdpNotification("error","Something went wrong and we couldn't save your settings."):t.cdpNotification("success","All your settings were saved!",2e3)}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't save your settings. – Please check console for more info."),console.log(e)})}),t("#cdp-show-into-again").on("click",function(){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"intro_again"}).done(e=>{"error"==e&&t.cdpNotification("error","Something went wrong and we couldn't update intro settings – try again!")}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't update intro settings. – Please check console for more info.")}),t(".cdp-s-i-a").animate({opacity:0},300,function(){t(".cdp-s-i-a").hide()}),function(){t(".cdp-intro").show().css({height:""});let e=t(".cdp-intro").height();t(".cdp-intro").css({height:"0px"}),t(".cdp-intro").animate({opacity:1,height:e+"px"},300,function(){})}()}),t(".cdp-show-projects").on("click",function(){t(".cdp-projects").is(":hidden")&&t(".cdp-projects").show(300);t(".cdp-show-projects").removeClass("cdp-pointer").animate({opacity:.5},300)}),t(".cdp-project-box").on("mouseenter",function(){t(".cdp-project-box").not(t(this)).addClass("cdp-half-opacity")}),t(".cdp-project-box").on("mouseleave",function(){t(".cdp-project-box").removeClass("cdp-half-opacity")}),t(".cdp-collapsible-title").on("click",r),t(".cdp-magic-input").on("keyup change",function(){before=t(this).html(),text=t(this).html(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],text=text.replace(/\[Counter\]/g,$picks[0]),text=text.replace(/\[CurrentDate\]/g,$picks[2]),text=text.replace(/\[CurrentTime\]/g,$picks[1]),text!=before&&t(this).html(text)}),t(".cdp-magic-input").on("focus",function(e,o){if(o)return;let i=t(this).text();" "!=i[0]&&(i="&nbsp;"+i);" "!=i[i.length-1]&&(i+="&nbsp;");t(this).html(i),h(this)}),t(".cdp-magic-input").on("mouseup",".cdp-name-box-small",function(){t(this).hide(300),setTimeout(()=>{t(this).remove(),u()},300)}),t(".cdp-support-animated").on("mouseenter",function(){t(".cdp-support-animated").not(t(this)).addClass("cdp-half-opacity")}),t(".cdp-name-clickable").on("mouseup",function(e){if(e.preventDefault(),$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],$box={1:".cdp-names-prefix",2:".cdp-names-real-input",3:".cdp-names-suffix"},t($box[e.which]).append($picks[t(this).attr("data-cdp-val")]),u(),e.which==e)return!1}),t(".cdp-support-animated").on("mouseleave",function(){t(".cdp-support-animated").removeClass("cdp-half-opacity")}),t(".cdp-f-einput-n").on("click","button",function(){let e=t(t(this).parents(".cdp-cf")[0]).find("input"),o=t(this).text(),i="12";"V"==o[0]?i="-51":"D"==o[0]&&(i="23");if(e.val().trim().length<=0)return void t.cdpNotification("warning","Please enter license key, currently it is empty.");t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"i_love_squirrels",rat:e.val(),m:i}).done(o=>{t.isJsonString(o)&&(o=t.cdpParse(o)),"success"==o.status?"valid"==o.data.license?(t.cdpNotification("success","License is already active, let us reload the page!"),setTimeout(()=>{window.location.reload()},2e3)):"site_inactive"==o.data.license?(t.cdpNotification("success","License is valid, press the button again to activate!"),e.prop("disabled",!0),t(this).text("Activate")):void 0!==o.data&&void 0!==o.data.msg?(t.cdpNotification("success",o.data.msg),setTimeout(()=>{window.location.reload()},2e3)):t.cdpNotification("warning","Unknown response, please try refresh the page!"):"fail"==o.status?t.cdpNotification(o.fail.type,o.fail.msg):t.cdpNotification("error","Something went wrong and we couldn't send request, please try refresh page and try again.")}).fail(e=>{t.cdpNotification("error","Something went wrong and we couldn't send request, are you connected to the internet?")})}),t(".cdp-names-real-input, .cdp-date-picked").on("keyup change",u),t('.cdp-other-options[name="after_copy"]').on("change",m),t("body").on("change keyup",".cdp-input-dynamic",function(){$input=t(t(".cdp-tooltip-content, .cdp-modal-content").find(`[name="${t(this).attr("name")}"]`)),"checkbox"==t(this).attr("type")?$input.prop("checked",t(this).is(":checked")):t($input).is("select")?($input.val(t(this).val()),t($input).hasClass("cdp-modal-input-profiles-r")&&g(!1,t(this).val())):$input.val(t(this).val());if(cdp_tooltips_update_content(),t($input).is("select")&&t($input).hasClass("cdp-premium-modal-dropdown")){let e=t("div.cdp-premium-modal-dropdown"),o=t(t(this).parents("div")[0]).find("div.cdp-premium-modal-dropdown");"2"==o.find("li.selected").data("value")?(e.find("span.current").addClass("cdp-relative"),e.find("span.current").html('Change the type of this copy <span class="cdp-premium-icon cdp-big-icon"></span>')):e.find("span.current").removeClass("cdp-relative")}}),t("body").on("click",".cdp-tooltip-before-button",function(){let e=t('.cdp-input-dynamic[name="tooltip-which-profile-first"]').val();"custom"!=e&&g(!1,e);t(".cdp-tooltip-before-options").hide(200),setTimeout(()=>{t(".cdp-tooltip-full-options").show(200),setTimeout(()=>{L()},200)},200)}),t("body").on("click",".cdp-tooltip-btn-copy",f),t("body").on("change",'.cdp-input-dynamic[name="tooltip-which-profile-second"]',g),t("body").on("change",'.cdp-input-dynamic[name="tooltip-which-profile-first"]',function(){g(!1,t(this).val())}),t("body").on("change",".cdp-modal-checkboxes .cdp-input-dynamic",function(){t('.cdp-input-dynamic[name="tooltip-which-profile-second"]').val("custom_named"),cdp_tooltips_update_content(),g(!1,"custom_named")}),t("body").on("change",".cdp-modal-input-times-tooltip",b),t("body").on("change",".cdp-modal-input-times",b),t("body").on("click",".cdp-modal-times, .cdp-modal",t.cdpModalClose),t("body").on("click",".cdp-modal-open",t.cdpModal),t("body").on("change",".cdp-profile-selected",x),t("body").on("click",".cdp-show-more-d-title",function(e){e.preventDefault(),t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-more-d-title").is(":hidden")?(t(".cdp-more-d-title").show(300),t(this).text("(hide more options)")):(t(".cdp-more-d-title").hide(300),t(this).text("(show more options)"));setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-d-first-chapter-cb",function(){t(".cdp-d-section").css({"max-height":"",height:""});let e=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")+0,o=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")+0,i=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")+0;e+o+i>1?t(".cdp-d-option-select-parent").show(300):t(".cdp-d-option-select-parent").hide(300);setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("click",".cdp-d-search",function(){let e=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")?1:0,o=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")?1:0,n=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")?1:0;e+o+n<=0?t.cdpNotification("error","Please, check for: which duplicates you are looking for"):null==c?function(e=function(){}){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_all_posts"}).done(o=>{t.isJsonString(o)&&(o=t.cdpParse(o)),e(o)}).fail(o=>{t.cdpNotification("error","Something went wrong and we couldn't get post list. – Please check console for more info."),console.log(o),e(!1)})}(t=>{0!=t&&p(t)}):p(c);function d(t,e){let o=parseInt(e[e.length-1]);for(let i=e.length;i>0&&(o=parseInt(e[i-1]),ext=!1,t.posts.findIndex(t=>t.ID==o)>=0?ext=!0:t.pages.findIndex(t=>t.ID==o)>=0?ext=!0:t.custom.findIndex(t=>t.ID==o)>=0?ext=!0:o=!1,1!=ext);--i);return o}function p(e){let o={posts:[],pages:[],custom:[]},n={},p={};null!=c&&(o=c);let h=!!t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked"),m=!!t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked"),f=!!t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked"),g=!!t('.cdp-d-option[name="cdp-d-b-title"]').is(":checked"),y=!!t('.cdp-d-option[name="cdp-d-b-slug"]').is(":checked"),v=!!t('.cdp-d-option[name="cdp-d-c-excerpt"]').is(":checked"),b=!!t('.cdp-d-option[name="cdp-d-c-count"]').is(":checked"),w=t('.cdp-d-option-select[name="cdp-d-d-sel-which"]').val(),k=null,x=null;if(h+m+f>1&&(k=t('.cdp-d-option-select[name="cdp-d-sels-diftyp"]').val()),1==g&&(x="1"==t('.cdp-d-option[name="cdp-radio-btn-dtitles"]:checked').val()),null==c)for(post_type in e)if("meta"!=post_type)for(post in e[post_type]){post=e[post_type][post],post.post_type=post.post_type[0].toUpperCase()+post.post_type.slice(1);let i=e.meta[post.ID]._cdp_origin,c=e.meta[post.ID]._cdp_counter,n=e.meta[post.ID]._cdp_origin_title,s=r(post.post_content),a={id:post.ID,url:post.guid,slug:post.post_name,type:post.post_type,date:post.post_date,title:post.post_title,status:post.post_status,edit:post.post_modified,excerpt:post.post_excerpt,words:u(s),origin:"object"==typeof i&&d(e,i),counter:"object"==typeof c&&c[c.length-1],origin_title:"object"==typeof n&&n[0]};if(l&&t.cdp.isPremium()&&(a.content=t.cdp.premium.prepareAdvanced(s),a.author=t.cdp.premium.prepareAdvanced(post.post_author)),"object"==typeof i){let t=parseInt(i[i.length-1]);void 0===p[t]?p[t]=1:p[t]++}o[post_type].push(a)}o=function(t){let e=JSON.parse(JSON.stringify(t));return e.posts.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e.pages.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e.custom.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e}(o),null==c&&(c=o);let _=[],C=[],T=!1,j=0,N=0,D=[],P=[],S=[];if("2"==k){j=1;let t=[],e=[],i=[];1==h&&(t=o.posts),1==m&&(e=o.pages),1==f&&(i=o.custom),_=(_=[].concat(t,e,i)).sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),C=M(_)}else{let t=[],e=[],i=[];1==h&&(j+=1),1==m&&(j+=1),1==f&&(j+=1),o.posts=o.posts.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==h&&(t=M(o.posts)),o.pages=o.pages.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==m&&(e=M(o.pages)),o.custom=o.custom.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0),1==f&&(i=M(o.custom)),C=[].concat(t,e,i)}function Q(e){1==++N&&(D=e),2==N&&(P=e),3==N&&(S=e),N==j&&function(e){for(post in $tbody=t("#cdp-d-table-tbody"),$tbody.html(""),e)$tbody.append((o=e[post],t(`<tr data-id="${o.id}">\n <td><input type="checkbox" id="cdp_in_${o.id}" class="cdp-input-d-id" name="${o.id}"/></td>\n <td><label for="cdp_in_${o.id}">${o.title}</label></td>\n <td><a href="${o.url}" target="_blank">${""!=o.slug?o.slug:o.url}</a></td>\n <td>${o.type}</td>\n <td>${o.date.slice(0,-8)}</td>\n <td>${o.words}</td>\n </tr>`)));var o;if("1"==w)for(parent in n)for(child in n[parent])t(`.cdp-input-d-id[name="${n[parent][child]}"]`).prop("checked",!0);else if("2"==w)for(parent in n){t(`.cdp-input-d-id[name="${parent}"]`).prop("checked",!0);let e=Math.max(...n[parent]);for(child in n[parent])n[parent][child]!=e&&t(`.cdp-input-d-id[name="${n[parent][child]}"]`).prop("checked",!0)}else"3"==w&&t(".cdp-input-d-id").prop("checked",!0);s=n,a=w;let c=!(g||y||v||b),d=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")+0,p=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")+0,l=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")+0;c&&d+p+l>0&&e.length>0?(t("#cdp-d-table-tbody").find("tr").attr("data-ignore",!0),i.refresh(),t(".cdp-delete-info").hide(300),t('[data-empty-info="true"]').find("div").html('You did not select any filter.<br>Click <a href="#" class="cdp-show-the-copies">here</a> to show all copies (of the selected post type) made by this plugin.'),t('[data-empty-info="true"]').addClass("cdp-customized")):i.refresh();t(".cdp-d-searchbox-c").val(""),$(),0==e.length?(t.cdpNotification("warning","No posts/pages meeting the current filter conditions."),t(".cdp-delete-info").hide(300)):t(".cdp-not-yet-search").is(":visible")||(t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-not-yet-search").show(300),t('[data-empty-info="true"]').hasClass("cdp-customized")||t(".cdp-delete-info").show(300),setTimeout(()=>{t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-d-section").css({"max-height":`${t(".cdp-d-section").height()}px`})},320))}(C=[].concat(D,P,S))}function M(e){let o=[],i=[],c=!(g||y||v||b);if(!e)return o;function d(t,e){if(t.id==e.origin&&0!=e.origin_title){let t=e.origin_title.replace(/\[Counter\]/g,e.counter);if(e.title==t)return!0}return!1}function p(t){for(let e=0;e<t.length;e++){let o=t[e];if(!i.includes(o.id))for(let n=c?0:e;n<t.length;n++){if(!t[n])continue;if(i.includes(t[n].id))continue;if(n==e)continue;let p=1==g&&(o.title==t[n].title||1==x&&d(o,t[n])),a=1==y&&I(o.slug,t[n].slug)>=.85,l=!1;l=1==p||1==a?1==v&&(""==o.excerpt||o.excerpt==t[n].excerpt):1==v&&""!=o.excerpt&&o.excerpt==t[n].excerpt;let r=1==b&&o.words==t[n].words,u=1==c&&o.id==t[n].origin&&t.findIndex(e=>e.origin==t[n].id)<=-1;!p&&g||!a&&y||!l&&v||!r&&b||!u&&c||(s(o,!0,!1),s(t[n],!1,o.id))}}Q(o)}function s(t,e=!1,c=!1){i.includes(t.id)||(1==e?n[t.id]=[]:0!=c&&n[c].push(t.id),i.push(t.id),o.push(t))}l&&t.cdp.isPremium()?t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"get_authors"}).done(o=>{if(t.isJsonString(o)&&(o=t.cdpParse(o)),"success"===o.status){let i=o.users;p(e=t.cdp.premium.advancedfilter(e,i))}else!1===T&&(t.cdpNotification("info","Cannot connect to the server, premium filters will not be applied."),T=!0),p(e)}).fail(()=>{!1===T&&(t.cdpNotification("info","Cannot connect to the server, premium filters will not be applied."),T=!0),p(e)}):p(e)}}function r(t){return(t=(t=(t=t.replace(/\<\!\-\-(.*?)\-\-\>/gim,"")).replace(/<[^>]*>/gim," ")).replace(/\s+/gim," ")).trim()}function u(t){return(t=t.split(" ")).length}}),t("body").on("change",".cdp-input-d-id",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),o=parseInt(t(".cdp-t-d-ct").text());t(this).is(":checked")?(o++,t(this).parents("tr").addClass("cdp-del")):(o--,t(this).parents("tr").removeClass("cdp-del"));if(t(".cdp-t-d-ct").text(o),o==e)t(".cdp-d-select-all").text("Deselect all"),t(".cdp-d-checkbox-all").prop("checked",!0);else{t(".cdp-d-select-all").text("Select all");let e=t(".cdp-input-d-id:visible");for(let o=0;o<e.length;++o){if(!t(e[o]).is(":checked")){t(".cdp-d-checkbox-all").prop("checked",!1);break}o==e.length-1&&t(".cdp-d-checkbox-all").prop("checked",!0)}}}),t("body").on("change",".cdp-d-checkbox-all",function(e){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return e.preventDefault(),void t(this).prop("checked",!1);let o=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),i=t(".cdp-d-checkbox-all").is(":checked"),c=t(".cdp-input-d-id:visible"),n=0;for(let e=0;e<c.length;++e)t(c[e]).is(":checked")&&!i?n--:!t(c[e]).is(":checked")&&i&&n++,t(c[e]).prop("checked",i);let d=parseInt(t(".cdp-t-d-ct").text())+n;t(".cdp-t-d-ct").text(d),d==o?t(".cdp-d-select-all").text("Deselect all"):t(".cdp-d-select-all").text("Select all");let p=t(".cdp-input-d-id:visible").parents("tr"),s=t(".cdp-input-d-id:visible:checked").parents("tr");p.removeClass("cdp-del"),s.addClass("cdp-del")}),t("body").on("click",".cdp-d-select-all",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),o=parseInt(t(".cdp-t-d-ct").text()),i=!0;e==o&&(i=!1);$chbs=t(".cdp-input-d-id");for(let e=0;e<$chbs.length;++e)t($chbs[e]).prop("checked",i);t(".cdp-t-d-ct").text(1==i?e:"0"),0==i?(t(".cdp-d-select-all").text("Select all"),t(".cdp-d-checkbox-all").prop("checked",!1),t(".cdp-input-d-id").parents("tr").removeClass("cdp-del")):(t(".cdp-d-checkbox-all").prop("checked",!0),t(".cdp-d-select-all").text("Deselect all"),t(".cdp-input-d-id").parents("tr").addClass("cdp-del"))}),t("body").on("click",".prev_page, .next_page, .page_link",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;t(".cdp-input-d-id:visible:checked").length==t(".cdp-input-d-id:visible").length?t(".cdp-d-checkbox-all").prop("checked",!0):t(".cdp-d-checkbox-all").prop("checked",!1)}),t("body").on("click",".cdp-d-real-delete",function e(o=!1,n=null,d=0){if(!t(".cdp-d-just-check-it").is(":checked"))return void t.cdpNotification("warning","Please check that you completed all steps, before this task!");let p=[];if(null===n){let e=t(".cdp-input-d-id:checked");for(let o=0;o<e.length;++o)p.push(parseInt(t(e[o]).attr("name")));if(0==p.length)return void t.cdpNotification("warning","Nothing to do here, please select at least one post to delete.")}else p=n;let u=t(".cdp-d-throttling").val(),h=t(".cdp-d-throttling-count").val(),m=t(".cdp-p-redirections").val(),f=!!t(".cdp-p-just-trash-them").is(":checked"),g=null,y="1"==t('.cdp-dis-en-opt[name="cdp-redirections"]').val();if("1"==u&&(!h||0==h||""==h))return void t.cdpNotification("warning","You have wrong count in throttling field, please fix.");l&&t.cdp.isPremium()&&(g=t.cdp.premium.auitd(a,s));if(p.length>801&&!0!==o){let t=Math.ceil(p.length/800);for(let o=0,i=!0;o<t;++o)o==t-1&&(i=!1),e(i,p.slice(800*o,800*o+800),o);return}t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"delete_them",ids:p,throttling:u,thc:h,redi:m,thrs:f,auit:y,auitd:g}).done(e=>{if(t.isJsonString(e)&&(e=t.cdpParse(e)),"success"==e.status){t("#cdp-d-table-tbody").find(".cdp-del").remove();let e=c.posts.filter(t=>!p.includes(t.id)),n=c.pages.filter(t=>!p.includes(t.id)),s=c.custom.filter(t=>!p.includes(t.id));c={posts:e,pages:n,custom:s},!0!==o&&i.refresh(),$(),0==d&&t.cdpNotification("success","Deletion process started, you can close this page now and wait till the process ends!"),_(C),!0!==o&&($parent=t(".cdp-d-section").parents(".cdp-collapsible"),$col=t(t($parent[0]).find(".cdp-collapsible-title")[0]),r("true",$col))}else!0!==o&&t.cdpNotification("error",`Something went wrong and we couldn't setup the deletion task. ${"1"==u?"– Please try without throttling.":""}`)}).fail(e=>{!0!==o&&t.cdpNotification("error","Something went wrong and we couldn't setup the deletion task. – Please check console for more info."),console.log(e)})}),t("body").on("change",".cdp-d-throttling",function(){t(".cdp-d-section").css({"max-height":"",height:""}),"1"==t(this).val()?t(".cdp-d-throttling-count-p, .cdp-even-more-th-info").show(300):t(".cdp-d-throttling-count-p, .cdp-even-more-th-info").hide(300);setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-d-throttling-count",function(){let e=parseInt(t(this).val());isNaN(e)?t(this).val(1):e>=1&&e<=10240?e>=1&&e<=1&&t(this).val(1):e<1?t(this).val(1):t(this).val(10240)}),t("body").on("change",".cdp-custom-date-picking",u),t("body").on("mouseover",".cdp-tooltip-copy",function(){t(this).hasClass("tooltipstered")||(t(this).tooltipster({delay:100,timer:400,debug:!1,delayTouch:[100,200],interactive:!0,distance:4,side:"bottom",contentAsHTML:!0,content:t(".cdp-tooltip-content").html(),repositionOnScroll:!0,selfDestruction:!1,trigger:"custom",triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{mouseleave:!0,click:!0,tap:!0},functionBefore:Q,functionReady:M,functionAfter:A,functionFormat:O}),t(this).tooltipster("open"),t("#cdp-hideTT").length>0&&t(".tooltipster-base").hide())}),t("body").on("keyup",".cdp-d-searchbox-c",function(){if(t('[data-empty-info="true"].cdp-customized').length>0)return;let e=t(this).val();e.length>100&&(e=e.substr(0,100));if(e=(e=e.trim().replace(/\s+/gim," ").toLowerCase()).split(" "),$trs=t("#cdp-d-table-tbody").find("tr"),$trs.length<=0)return;$trs.removeAttr("data-ignore");for(let o=0;o<$trs.length;++o){$tr=t($trs[o]),$title=t($tr.find("td")[1]).text().toLowerCase(),$url=t($tr.find("td")[2]).text().toLowerCase();let i=!1;for(let t=0;t<e.length;++t)if($title.includes(e[t]))i=!0;else{if(!$url.includes(e[t])){i=!1;break}i=!0}0==i&&$tr.attr("data-ignore","true")}clearTimeout(p),p=setTimeout(()=>{i.refresh()},20)}),t("body").on("change",".cdp-data-set",T),t("#wpbody").on("scroll",j),t(window).on("scroll",j),t("body").on("click",".nice-select",j),t("body").on("click",".cdp-show-the-copies",function(e){e.preventDefault(),t(".cdp-d-section").css({"max-height":"",height:""}),t("#cdp-d-table-tbody").find("tr").not('[data-empty-info="true"]').removeAttr("data-ignore"),t(".cdp-d-searchbox-c").val(""),t('[data-empty-info="true"]').addClass("cdp-customized"),i.refresh(),$(),t(".cdp-d-section").css({"max-height":"",height:""}),parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text())>0&&t(".cdp-delete-info").show(300);t(".cdp-not-yet-search").is(":visible")||(t(".cdp-not-yet-search").show(300),t('[data-empty-info="true"]').hasClass("cdp-customized")||t(".cdp-delete-info").show(300));setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-per-page-select-show",function(){let e=t(this).val();i.changePageSize(e)}),t("body").on("change",'.cdp-d-option[name="cdp-d-b-title"]',N),t("body").on("change",'.cdp-d-option[name="cdp-d-b-slug"]',N),t("body").on("click",".cdp-tab-element",function(){if(t(this).hasClass("cdp-tab-active"))return;if("true"==t(this).attr("data-disabled"))return;let e=t(t(`#${t(this).attr("data-box")}`)[0]),o=t(t(`#${t(".cdp-tab-active").attr("data-box")}`)[0]);if(!e||e.length<=0)return;t(".cdp-tab-active").removeClass("cdp-tab-active"),t(this).addClass("cdp-tab-active"),e.show(),e.css({"max-height":"",height:""});let i=e.height();e.css({"max-height":"0px",opacity:0}),e.animate({"max-height":i+"px",opacity:1},500,function(){let e=t(".cdp-d-section").height();t(".cdp-d-section").css({height:e+"px","max-height":e+"px"})}),t(".cdp-d-section").css({height:"","max-height":""}),o.css({"max-height":o.height()+"px",opacity:1}),o.animate({"max-height":"0px",opacity:0},500,function(){o.hide()}),setTimeout(()=>{o.css({"max-height":"",height:""}),e.css({"max-height":"",height:""})},510);let c=parseInt(t(window).height()/8);t("#wpbody").animate({scrollTop:jQuery(".cdp-d-section")[0].offsetTop-c},500)}),t("body").on("click",".cdp-premium-element",function(t){t.preventDefault()}),t("body").on("click",".cdp-go-to-names-chapter",function(e){e.preventDefault(),z(),r("cdp-name-section-cnx"),setTimeout(()=>{let e=parseInt(t(window).height()/4);t("#wpbody").animate({scrollTop:t(".cdp-name-section-cnx")[0].offsetTop-e},500)},400)}),t("body").on("click",".cdp-close-chapter",D),t("body").on("click",".cdp-save-options",D),t("body").on("click",".cdp-togglable-name-b",function(){"(Name of original)"==t(".cdp-togglable-name-b").text()?(t(".cdp-togglable-name-b").text("(blank)"),t(".cdp-togglable-name-b").tooltipster("content","Change it to (Name of original)")):(t(".cdp-togglable-name-b").text("(Name of original)"),t(".cdp-togglable-name-b").tooltipster("content","Change it to blank"));u()}),t("#cdp_jvlabelWrap-fake").on("click",function(){if(0===t("#support-cdp").length){t(t(".cdp-container")[0]).append('<script id="support-cdp" src="//code.jivosite.com/widget/MoP3Jphzts" async><\/script>'),setTimeout(function(){t("#cdp_jvlabelWrap-fake").hide()},100);var e=!1;let o=setInterval(function(){1==e&&clearInterval(o),void 0!==window.jivo_api&&(window.jivo_api.open(),e=!0)},30)}}),t(".cdp-select").niceSelect(),t(".cdp-tooltip").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:4,side:"top",contentAsHTML:!0,maxWidth:600,triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{mouseleave:!0,click:!0,tap:!0},theme:["tooltipster-noir","tooltipster-noir-customized"],repositionOnScroll:!0,functionReady:L}),t("#cdp-d-table").length>0&&(i=new IcPagination(t("#cdp-d-table"),"#cdp-d-table-pagi",{itemsOnPage:25,useParams:!1,emptylist:'<div class="cdp-center">No items to show, try with other filters!</div>'})),t(".cdp-copy-button").on("mouseup",function(){f(!0)});let P=(e,o,i,c)=>t(`<a class="ab-item cdp-dropdown-menu cdp-dd-item cdp-dd-ud${0==e?" cdp-bnew-notis":""}" data-token="${o}">\n <div style="display: block; width: calc(100% - 3px);">\n <div class="cdp-dropdown-left${1==i?" cdp-red":""}">${"delete"==c?"Deleting Posts":"Auto Cleaning-up"}</div>\n <div class="cdp-dropdown-right cdp-noti-kill-btn">Kill</div>\n </div>\n </a>`),S=(e,o,i,c)=>{let n="",d="";return void 0!==e&&(void 0!==e["formated-date"]&&(n=e["formated-date"]),void 0!==e.text&&(d=e.text),""!=d&&(d='data-ftext="'+d+'" '),""!=n&&(n='data-fdate="Completed at '+n+'" ')),t(`<a ${n}${d}class="ab-item cdp-dropdown-menu cdp-dd-item cdp-dd-d${0==o?" cdp-bnew-notis":""}" data-token="${i}">\n <div style="display: block; width: calc(100% - 3px);">\n <div class="cdp-dropdown-left">${"delete"==c?"Deleted Posts":"Auto Cleaned-up"}</div>\n <div class="cdp-dropdown-right cdp-noti-hide-btn">Hide</div>\n </div>\n </a>`)};function I(t,e){let o=t,i=e;t.length<e.length&&(o=e,i=t);let c=o.length;return 0==c?1:(c-function(t,e){t=t.toLowerCase(),e=e.toLowerCase();let o=new Array;for(let i=0;i<=t.length;i++){let c=i;for(let n=0;n<=e.length;n++)if(0==i)o[n]=n;else if(n>0){let d=o[n-1];t.charAt(i-1)!=e.charAt(n-1)&&(d=Math.min(Math.min(d,c),o[n])+1),o[n-1]=c,c=d}i>0&&(o[e.length]=c)}return o[e.length]}(o,i))/parseFloat(c)}function Q(o,i){z(!0),t(".cdp-tooltip-before-options").show(),t(".cdp-tooltip-full-options").hide(),$inputs=t(t(".cdp-tooltip-content").find("input, select"));for(let e=0;e<$inputs.length;++e){let o=t($inputs[e]);if("checkbox"==o.attr("type"))o.is(":checked")?o.attr("checked","checked"):o.removeAttr("checked");else if(t(o).is("select"))if("tooltip-which-profile-first"==t(o).attr("name")){let e=t(t('[name="tooltip-which-profile-first"]')[0]).val();"custom"==e||null==e?setTimeout(()=>{t('[name="tooltip-which-profile-first"]').val("custom")},50):setTimeout(()=>{t('[name="tooltip-which-profile-first"]').val(e)},50)}else{let e=t('[name="tooltip-which-profile-second"] option:selected').map(function(t,e){return this.value}).get()[0];"custom"==e||null==e?setTimeout(()=>{t('[name="tooltip-which-profile-second"]').val("custom")},50):setTimeout(()=>{t('[name="tooltip-which-profile-second"]').val(e)},50)}else o.attr("value",o.val())}return cdp_tooltips_update_content(),e=t(i.origin).attr("data-cdp-id"),!0}function M(e,o){$parent=t(o.origin).parents(".row-actions"),$parent.css({left:0});let i=t(t("a.menu-top.toplevel_page_copy-delete-posts")[0]).attr("href");t(".cdp-tooltip-info-intt").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:6,side:"top",contentAsHTML:!0,content:`Define your copy settings <a href="${i}">here</a>.`,maxWidth:400,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-center"],repositionOnScroll:!0}),l&&jQuery.cdp.isPremium()?t(".cdp-tooltip-premium-spc-3").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:"If you’re on a multisite you can copy it to other sites.",contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}):(t(".cdp-tooltip-premium-spc-2").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'If you’re on a multisite you can copy it to other sites with the Premium Plugin. <a href="https://sellcodes.com/CylMIdJD" target="_blank">Order it now!</a>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t(".cdp-tooltip-premium-spc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This is a Premium Feature.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Check it out and upgrade today</a>,<br>we made it <b>really affordable!</b>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").addClass("cdp-premium-element"),t(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").find("input, select").prop("disabled",!0),t(".cdp-tooltip-premium-spc-4").tooltipster("content",'You can copy it to other sites with the Premium Plugin.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>'),L(),cdp_tooltips_update_content())}function A(e,o){return $parent=t(o.origin).parents(".row-actions"),$parent.css({left:""}),!1}function O(){return t(t(".cdp-tooltip-content").html())}function L(){setTimeout(()=>{let e=t.tooltipster.instances();for(instance in e)e[instance].reposition()},10)}function z(e=!1){if(e){let e=t.tooltipster.instances();for(instance in e)e[instance].close()}else setTimeout(()=>{let e=t.tooltipster.instances();for(instance in e)e[instance].close()},10)}if(t(".cdp-admin-bar-noti").length>0&&setInterval(()=>{_(t=>{C(t)})},7e3),t(".cdp-drag-name").draggable({containment:".cdp-drags-cont",scroll:!1,helper:"clone",revert:"invalid"}),t(".cdp-names-real-input").droppable({drop:function(e,o){$picks=['<div class="cdp-name-box-small cdp-drag" data-cdp-val="0" contenteditable="false"><i class="cdp-novis">[</i>Counter<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="1" contenteditable="false"><i class="cdp-novis">[</i>CurrentTime<i class="cdp-novis">]</i></div>','<div class="cdp-name-box-small cdp-drag" data-cdp-val="2" contenteditable="false"><i class="cdp-novis">[</i>CurrentDate<i class="cdp-novis">]</i></div>'],t(this).html(`${t(this).html()}${$picks[t(o.helper).attr("data-cdp-val")]}`),u()}}),"undefined"!=typeof pagenow&&["edit-page","edit-post"].includes(pagenow)&&t(".column-cb, .check-column").find("input").prop("checked",!1),t("#titlediv").find(".inside").length>0&&t("#cdp-original-post").length>0){let e=t("#cdp-original-post").attr("data-cdp-parent"),o=t("#cdp-original-post").attr("data-cdp-parent-url");t("#titlediv").find(".inside").append(t(`<div style="padding-left: 10px">This post is a duplicate of <a href="${o}" target="_blank">${e}</a></div>`))}t(".cdp-preloader-c").length>0&&(u(),m(),x(),setTimeout(()=>{h(".cdp-names-prefix"),h(".cdp-names-suffix")},1e3),function(){let e=t(".cdp-tab-active");for(let o=0;o<e.length;o++){let i=t(`#${t(e[o]).attr("data-box")}`);i.show(),i.css({"max-height":"",height:""});let c=i.height();t(c).css({"max-height":c+"px",height:c+"px"})}}()),setTimeout(()=>{t(".cdp-container").is(":hidden")&&t(".cdp-container").length>0&&setTimeout(()=>{jQuery(".cdp-preloader-c").hide(),jQuery(".cdp-container").css({opacity:0}),jQuery(".cdp-container").show(),jQuery("#wpfooter").show(300),jQuery(".cdp-container").animate({opacity:1},300)},400)},5e3)}),jQuery(window).on("load",function(){setTimeout(()=>{jQuery(".cdp-container").length>0&&(jQuery(".cdp-preloader-c").hide(),jQuery(".cdp-container").css({opacity:0}),jQuery(".cdp-container").show(),jQuery("#wpfooter").show(300),jQuery(".cdp-container").animate({opacity:1},300));const t=void 0!==jQuery.cdp&&void 0!==jQuery.cdp.isPremium;jQuery(".cdp-tooltip-premium-dc").tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'This is a Premium Feature.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Check it out and upgrade today</a>,<br>we made it <b>really affordable!</b>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),t&&jQuery.cdp.isPremium()?(jQuery(".cdp-tooltip-premium-spc-3").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:"If you’re on a multisite you can copy it to other sites.",contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),jQuery(".cdp-tooltip-premium-spc-3").addClass("cdp-premium-element"),jQuery(".cdp-tooltip-premium-spc-3").find("input, select").prop("disabled",!0)):(jQuery('.cdp-option-premium [value="3"]').prop("disabled",!0),setTimeout(()=>{jQuery(".cdp-premium-in-select").find('.option[data-value="premium"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-option-premium").find('.option[data-value="3"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-tooltip-premium-spc-2").tooltipster({delay:800,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:'If you’re on a multisite you can copy it to other sites with the Premium Plugin. <a href="https://sellcodes.com/CylMIdJD" target="_blank">Order it now!</a>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),jQuery(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").addClass("cdp-premium-element"),jQuery(".cdp-tooltip-premium-spc, .cdp-tooltip-premium-spc-2").find("input, select").prop("disabled",!0),jQuery(".cdp-tooltip-premium-spc-4").tooltipster("content",'You can copy it to other sites with the Premium Plugin.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Pre-order it now</a>'),function(t){let e=void 0!==t?t:".cdp-tooltip-premium",o=-15;isNaN(parseInt(jQuery(e).attr("data-top")))||(o=parseInt(jQuery(e).attr("data-top")));jQuery(e).tooltipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:o,side:"top",content:'This is a Premium Feature.<br><a href="https://sellcodes.com/CylMIdJD" target="_blank">Check it out and upgrade today</a>,<br>we made it <b>really affordable!</b>',contentAsHTML:!0,maxWidth:290,theme:["tooltipster-noir","tooltipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0}),i=e,jQuery(i).addClass("cdp-premium-element"),jQuery(i).find("input, select").prop("disabled",!0);var i}(),cdp_tooltips_update_content()},1e3))},400)}),function(t){function e(t,e){if(!(t.originalEvent.touches.length>1)){t.preventDefault();let o=t.originalEvent.changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent(e,!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(i)}}if(t.support.touch="ontouchend"in document,t.support.touch){let o,i=t.ui.mouse.prototype,c=i._mouseInit,n=i._mouseDestroy;i._touchStart=function(t){!o&&this._mouseCapture(t.originalEvent.changedTouches[0])&&(o=!0,this._touchMoved=!1,e(t,"mouseover"),e(t,"mousemove"),e(t,"mousedown"))},i._touchMove=function(t){o&&(this._touchMoved=!0,e(t,"mousemove"))},i._touchEnd=function(t){o&&(e(t,"mouseup"),e(t,"mouseout"),this._touchMoved||e(t,"click"),o=!1)},i._mouseInit=function(){let e=this;e.element.bind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),c.call(e)},i._mouseDestroy=function(){let e=this;e.element.unbind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),n.call(e)}}}(jQuery);
banner/misc.php CHANGED
@@ -44,7 +44,7 @@
44
  $this->_root_dir = $root_dir;
45
 
46
  // Add handler for Ajax request
47
- if ($_SERVER['REQUEST_METHOD'] == 'POST') {
48
 
49
  // Check if slug is defined
50
  if (isset($_POST['slug']) && !empty($_POST['slug'])) {
@@ -446,7 +446,7 @@
446
  if (!defined('INISEV_CAROUSEL')) {
447
 
448
  // Make sure settings/menu page slug exsits
449
- if (!empty($_GET['page']) || $_SERVER['REQUEST_METHOD'] === 'POST') {
450
 
451
  // Initialize the Carousel
452
  $carousel = new Inisev_Carousel(__FILE__, __DIR__);
44
  $this->_root_dir = $root_dir;
45
 
46
  // Add handler for Ajax request
47
+ if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
48
 
49
  // Check if slug is defined
50
  if (isset($_POST['slug']) && !empty($_POST['slug'])) {
446
  if (!defined('INISEV_CAROUSEL')) {
447
 
448
  // Make sure settings/menu page slug exsits
449
+ if (!empty($_GET['page']) || (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST')) {
450
 
451
  // Initialize the Carousel
452
  $carousel = new Inisev_Carousel(__FILE__, __DIR__);
copy-delete-posts.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Copy & Delete Posts
4
  * Plugin URI: https://copy-delete-posts.com
5
  * Description: The best solution to easily make duplicates of your posts & pages, and delete them in one go.
6
- * Version: 1.1.4
7
  * Author: Copy Delete Posts
8
  * Author URI: https://copy-delete-posts.com/
9
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -31,7 +31,7 @@ if (!defined('ABSPATH')) exit;
31
  */
32
 
33
  // Plugin constants
34
- define('CDP_VERSION', '1.1.4');
35
  define('CDP_WP_VERSION', get_bloginfo('version'));
36
  define('CDP_SCRIPT_DEBUG', false);
37
  $cdp_plug_url = plugins_url('', __FILE__);
@@ -197,6 +197,14 @@ if (!defined('ABSPATH')) exit;
197
  if (is_object($post)) $type = $post->post_type;
198
  else $type = false;
199
 
 
 
 
 
 
 
 
 
200
  $ver = preg_replace('#[^\pL\pN/-]+#', '', CDP_VERSION);
201
  wp_enqueue_style('cdp-css-global', "{$cdp_plug_url}/assets/css/cdp-global{$min}.css", '', $ver);
202
  wp_enqueue_script('cdp-js-global', "{$cdp_plug_url}/assets/js/cdp-global{$min}.js", ['jquery'], $ver, true);
@@ -293,8 +301,16 @@ if (!defined('ABSPATH')) exit;
293
  // Main menu slug
294
  $parentSlug = 'copy-delete-posts';
295
 
 
 
 
 
 
296
  // Main menu hook
297
  add_menu_page('Copy & Delete Posts', '<span id="cdp-menu">Copy & Delete Posts</span>', 'read', $parentSlug, 'cdp_configuration', $icon_url, $position = 98);
 
 
 
298
 
299
  // Remove default submenu by menu
300
  remove_submenu_page($parentSlug, $parentSlug);
@@ -520,7 +536,7 @@ if (!defined('ABSPATH')) exit;
520
  }
521
  }
522
  }
523
- if ($cdp_globals && array_key_exists('others', $cdp_globals) && $cdp_globals['others']['cdp-premium-hide-tooltip'] == 'true') {
524
  $hx = true;
525
  }
526
 
@@ -530,8 +546,6 @@ if (!defined('ABSPATH')) exit;
530
  }
531
 
532
  if ($pagenow == 'edit.php') $post_id = false;
533
- error_log(print_r($cdp_globals, true));
534
- error_log(print_r($hx, true));
535
  cdp_vars($hx, $cdp_plug_url, $post_id, $hasParent, true);
536
  cdp_tooltip_content($profiles);
537
  cdp_modal($screen, $profiles);
@@ -710,7 +724,8 @@ if (!defined('ABSPATH')) exit;
710
  'cdp-references-post' => 'false',
711
  'cdp-references-edit' => 'false',
712
  'cdp-premium-import' => 'false',
713
- 'cdp-premium-hide-tooltip' => 'false'
 
714
  );
715
  }
716
  /** –– **/
3
  * Plugin Name: Copy & Delete Posts
4
  * Plugin URI: https://copy-delete-posts.com
5
  * Description: The best solution to easily make duplicates of your posts & pages, and delete them in one go.
6
+ * Version: 1.1.5
7
  * Author: Copy Delete Posts
8
  * Author URI: https://copy-delete-posts.com/
9
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
31
  */
32
 
33
  // Plugin constants
34
+ define('CDP_VERSION', '1.1.5');
35
  define('CDP_WP_VERSION', get_bloginfo('version'));
36
  define('CDP_SCRIPT_DEBUG', false);
37
  $cdp_plug_url = plugins_url('', __FILE__);
197
  if (is_object($post)) $type = $post->post_type;
198
  else $type = false;
199
 
200
+ if (isset($g['cdp-menu-in-settings']) && $g['cdp-menu-in-settings'] == 'true') {
201
+ ?>
202
+ <style media="screen">
203
+ #toplevel_page_copy-delete-posts { display: none; visibility: hidden; }
204
+ </style>
205
+ <?php
206
+ }
207
+
208
  $ver = preg_replace('#[^\pL\pN/-]+#', '', CDP_VERSION);
209
  wp_enqueue_style('cdp-css-global', "{$cdp_plug_url}/assets/css/cdp-global{$min}.css", '', $ver);
210
  wp_enqueue_script('cdp-js-global', "{$cdp_plug_url}/assets/js/cdp-global{$min}.js", ['jquery'], $ver, true);
301
  // Main menu slug
302
  $parentSlug = 'copy-delete-posts';
303
 
304
+ // Globals
305
+ $g = get_option('_cdp_globals', array());
306
+ if (array_key_exists('others', $g)) $g = $g['others'];
307
+ else $g = cdp_default_global_options();
308
+
309
  // Main menu hook
310
  add_menu_page('Copy & Delete Posts', '<span id="cdp-menu">Copy & Delete Posts</span>', 'read', $parentSlug, 'cdp_configuration', $icon_url, $position = 98);
311
+ if (isset($g['cdp-menu-in-settings']) && $g['cdp-menu-in-settings'] == 'true') {
312
+ add_submenu_page('tools.php', 'Copy & Delete Posts Menu', '<span id="cdp-menu">Copy & Delete Posts</span>', 'read', 'copy-delete-posts', 'cdp_configuration', 3);
313
+ }
314
 
315
  // Remove default submenu by menu
316
  remove_submenu_page($parentSlug, $parentSlug);
536
  }
537
  }
538
  }
539
+ if ($cdp_globals && array_key_exists('others', $cdp_globals) && array_key_exists('cdp-premium-hide-tooltip', $cdp_globals['others']) && $cdp_globals['others']['cdp-premium-hide-tooltip'] == 'true') {
540
  $hx = true;
541
  }
542
 
546
  }
547
 
548
  if ($pagenow == 'edit.php') $post_id = false;
 
 
549
  cdp_vars($hx, $cdp_plug_url, $post_id, $hasParent, true);
550
  cdp_tooltip_content($profiles);
551
  cdp_modal($screen, $profiles);
724
  'cdp-references-post' => 'false',
725
  'cdp-references-edit' => 'false',
726
  'cdp-premium-import' => 'false',
727
+ 'cdp-premium-hide-tooltip' => 'false',
728
+ 'cdp-menu-in-settings' => 'false',
729
  );
730
  }
731
  /** –– **/
menu/configuration.php CHANGED
@@ -572,6 +572,10 @@ function cdp_configuration() {
572
  <input id="cdp-o-premium-import"<?php echo ((!$areWePro)?' disabled="true"':''); ?> <?php echo ($areWePro && $gos['cdp-premium-import'] == 'true')?'checked ':''; ?> type="checkbox" class="cdp-other-inputs" name="cdp-premium-import" />
573
  <span class="cdp-relative cdp-tooltip-premium" data-top="5">Show post export & import buttons <span class="cdp-premium-icon cdp-big-icon" style="right: -30px"></span></span>
574
  </label>
 
 
 
 
575
  </div>
576
  <div class="cdp-center cdp-padding-15-h">
577
  <button class="cdp-button cdp-save-options">Save</button>
572
  <input id="cdp-o-premium-import"<?php echo ((!$areWePro)?' disabled="true"':''); ?> <?php echo ($areWePro && $gos['cdp-premium-import'] == 'true')?'checked ':''; ?> type="checkbox" class="cdp-other-inputs" name="cdp-premium-import" />
573
  <span class="cdp-relative cdp-tooltip-premium" data-top="5">Show post export & import buttons <span class="cdp-premium-icon cdp-big-icon" style="right: -30px"></span></span>
574
  </label>
575
+ <label for="cdp-o-menu-in-settings">
576
+ <input <?php echo (isset($gos['cdp-menu-in-settings']) && $gos['cdp-menu-in-settings'] == 'true')?'checked ':''; ?>id="cdp-o-menu-in-settings" type="checkbox" class="cdp-other-inputs" name="cdp-menu-in-settings">
577
+ Hide Copy & Delete Posts Menu under <b>Tools</b> dropdown
578
+ </label>
579
  </div>
580
  <div class="cdp-center cdp-padding-15-h">
581
  <button class="cdp-button cdp-save-options">Save</button>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: CopyDeletePosts, copydelete
3
  Tags: Duplicate post, Copy posts, Copy pages, Duplicate posts, Duplicate pages, Clone posts, Clone pages, Delete posts, Delete pages, Duplicator, copy post, copy page
4
  Requires at least: 4.6
5
- Tested up to: 5.6.1
6
- Stable tag: 1.1.4
7
  License: GPLv3
8
  Requires PHP: 5.6
9
 
@@ -147,6 +147,12 @@ Copy Delete Posts WordPress plugin doesn’t store any site visitor information
147
 
148
  == Changelog ==
149
 
 
 
 
 
 
 
150
  = 1.1.4 =
151
  * Tested up to WordPress 5.6.1
152
  * Added support chat
2
  Contributors: CopyDeletePosts, copydelete
3
  Tags: Duplicate post, Copy posts, Copy pages, Duplicate posts, Duplicate pages, Clone posts, Clone pages, Delete posts, Delete pages, Duplicator, copy post, copy page
4
  Requires at least: 4.6
5
+ Tested up to: 5.6.2
6
+ Stable tag: 1.1.5
7
  License: GPLv3
8
  Requires PHP: 5.6
9
 
147
 
148
  == Changelog ==
149
 
150
+ = 1.1.5 =
151
+ * Tested up to WordPress 5.6.2
152
+ * Fixed footer issue in Gutenberg editor
153
+ * Fixed notice in premium version (regarding new option)
154
+ * Added posibility to hide menu under tools
155
+
156
  = 1.1.4 =
157
  * Tested up to WordPress 5.6.1
158
  * Added support chat