HEX
Server: nginx/1.26.3
System: Linux tnswh.tainosystems.com 6.12.74+deb13+1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.74-2 (2026-03-08) x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/clients/client64/web77/web/wp-content/plugins/complianz-gdpr/assets/js/admin.min.js
jQuery(document).ready(function(r){"use strict";function i(t,c){let i=0,n=c.getAttribute("data-cmplz_loadmore_count");c.querySelectorAll(".cmplz-checkbox-container").forEach(e=>{i++,t?(c.querySelector(".cmplz_load_more .cmplz-load-less").style.display="block",c.querySelector(".cmplz_load_more .cmplz-load-more").style.display="none",e.style.display="block"):i>n&&(c.querySelector(".cmplz_load_more .cmplz-load-more").style.display="block",c.querySelector(".cmplz_load_more .cmplz-load-less").style.display="none",e.style.display="none")})}document.querySelector(".cmplz-multicheckbox-loadmore")&&(document.querySelectorAll(".cmplz-multicheckbox-loadmore").forEach(e=>{e.setAttribute("data-loadmore-state","hidden"),i(!1,e)}),document.addEventListener("click",t=>{if(t.target.closest(".cmplz_load_more")){t.preventDefault();let e=t.target;var t="hidden"===(e=e.closest(".cmplz-multicheckbox-loadmore")).getAttribute("data-loadmore-state"),c=t?"visible":"hidden";e.setAttribute("data-loadmore-state",c),i(t,e)}})),r(document).on("click",".cmplz-install-burst",function(){var c=r("button.cmplz-install-burst");c.html('<div class="cmplz-loader"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>'),c.attr("disabled","disabled"),r.ajax({type:"GET",url:complianz_admin.admin_url,dataType:"json",data:{step:"download",action:"cmplz_install_plugin",nonce:complianz_admin.nonce},success:function(e){r.ajax({type:"GET",url:complianz_admin.admin_url,dataType:"json",data:{step:"activate",action:"cmplz_install_plugin",nonce:complianz_admin.nonce},success:function(e){var t=r(".cmplz-completed-text").html();c.html(t)}})}})}),r(document).on("click",".regions .cmplz-checkbox-container input",function(){e()});r(".regions .cmplz-checkbox-container input");function e(){r("select[name=cmplz_other_region_behaviour]").length&&r(".regions .cmplz-field").find(":checkbox").each(function(e){var t=r(this).attr("name").replace("]","").replace("cmplz_regions[",""),t=r("select[name=cmplz_other_region_behaviour] option[value="+t+"]");r(this).is(":checked")?t.removeAttr("disabled"):t.attr("disabled","disabled")})}e(),r(document).on("click",".cmplz-copy-shortcode",function(){let c=r(this),t;var e=r(this).children(".cmplz-copy-shortcode-text"),i=(r(this).addClass("cmplz-click-animation"),r("<input>"));r("body").append(i),i.val(e.text()).select();try{t=document.execCommand("copy")}catch(e){t=!1}if(i.remove(),t){let e=r(this).children(".cmplz-tooltip"),t=e.attr("cmplz-tooltip");e.attr("cmplz-tooltip",complianz_admin.copy_text),setTimeout(function(){c.removeClass("cmplz-click-animation"),e.attr("cmplz-tooltip",t)},2e3)}});var t=r(".cmplz_save_localstorage");function c(){r(".multiple-field").each(function(){var e=!0,t=(r(this).find("input[type=text]").each(function(){""===r(this).val()&&(e=!1)}),r(this).find("textarea").each(function(){""===r(this).val()&&(e=!1)}),r(this).closest(".cmplz-panel").find(".cmplz-multiple-field-validation i"));e?(t.removeClass("fa-times"),t.addClass("fa-check")):(t.addClass("fa-times"),t.removeClass("fa-check"))})}function n(){r(".cmplz-validate-multicheckbox").each(function(e){var t=[],c=!0,i=(r(this).find(":checkbox").each(function(e){t.push(r(this)),r(this).is(":checked")&&(c=!1)}),r(this).closest(".field-group").find(".cmplz-label"));c?(i.removeClass("valid-multicheckbox"),i.addClass("invalid-multicheckbox"),r.each(t,function(e,t){t.prop("required",!0),t.addClass("is-required")})):(i.removeClass("invalid-multicheckbox"),i.addClass("valid-multicheckbox"),r.each(t,function(e,t){t.prop("required",!1),t.removeClass("is-required")}))}),a()}function a(){var d,m=!0;r(".condition-check-1").each(function(e){for(var t=1;t<4;t++){var c="cmplz_"+r(this).data("condition-question-"+t);if("cmplz_undefined"==c)return;var i=r(this).data("condition-answer-"+t),n=r(this).find("input[type=checkbox]"),a=((n=(n=(n=n.length?n:r(this).find("input")).length?n:r(this).find("textarea")).length?n:r(this).find("select")).length&&n[0].hasAttribute("required")&&n.addClass("is-required"),m=-1===(i+="").indexOf("NOT ")||(i=i.replace("NOT ",""),!1),[]),a=-1!==i.indexOf(" OR ")?i.split(" OR "):[i],l=r(this),s=r(this).data("fieldname"),o=!1;if(a.forEach(function(e){d=function(e){{var t;return"text"==r('input[name="'+e+'"]').attr("type")?r("input[name^="+e+"]").val():(t=[],r('input[name="'+e+'"]:checked').each(function(){t[t.length]=r(this).val()}),t)}}(c),r('select[name="'+c+'"]').length&&(d=Array(r("select[name="+c+"]").val())),r("input[name='"+c+"["+e+"]']").length&&(d=(o=!!r("input[name='"+c+"["+e+"]']").is(":checked"),[])),m?o||-1!=d.indexOf(e)||d==e?(l.removeClass("cmplz-hidden"),r("."+s).removeClass("cmplz-hidden"),n.hasClass("is-required")&&n.prop("required",!0),o=!0):(l.addClass("cmplz-hidden"),r("."+s).addClass("cmplz-hidden"),n.hasClass("is-required")&&n.prop("required",!1)):o||-1!=d.indexOf(e)||d==e?(l.addClass("cmplz-hidden"),r("."+s).addClass("cmplz-hidden"),n.hasClass("is-required")&&n.prop("required",!1)):(l.removeClass("cmplz-hidden"),r("."+s).removeClass("cmplz-hidden"),n.hasClass("is-required")&&n.prop("required",!0),o=!0)}),!o)break}})}t.length&&t.each(function(){var e=r(this).attr("name"),t=window.localStorage.getItem(e),c=r(this).val();null==t||0<!r(this).find("option[value="+t+"]").length?(t=c,window.localStorage.setItem(e,t),r(this).val(t).change()):null!=t&&t!==c&&r(this).val(t).change()}),r(document).on("change",".cmplz_save_localstorage",function(){var e=r(this).attr("name"),t=r(this).find(":selected").val();window.localStorage.setItem(e,t)}),r(document).on("change",".cmplz-download-document-selector",function(){var e=r(this);0!=e.find(":selected").val().length?e.closest(".cmplz-document").find("button").attr("disabled",!1):e.closest(".cmplz-document").find("button").attr("disabled",!0)}),r(document).on("click",".cmplz-download-document",function(e){e.preventDefault();var t=r(this),c=t.html(),e=r(this).closest(".cmplz-document").find("select").val(),i=r(this).closest(".cmplz-document").find("select option:selected").text(),n=(t.html('<div class="cmplz-loader"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>'),t.attr("disabled","disabled"),new XMLHttpRequest);n.responseType="blob",n.open("get",e,!0),n.send(),n.onreadystatechange=function(){var e,t;4==this.readyState&&200==this.status&&(e=window.URL.createObjectURL(this.response),(t=document.createElement("a")).setAttribute("href",e),t.setAttribute("download",i),document.body.appendChild(t),t.click(),setTimeout(function(){window.URL.revokeObjectURL(e)},6e4))},n.onprogress=function(e){t.html(c),t.removeAttr("disabled")}}),r(document).on("change",".cmplz-grid-selector",function(){var e=r(this).val(),t=r(this).attr("id"),c=window.location.href,i=function(e,t){if(void 0!==e){e=e.split("?");if(1!=e.length){var c,i,n=e[1].split("&");for(i=0;i<n.length;i++)if((c=n[i].split("="))[0]===t)return void 0===c[1]||decodeURIComponent(c[1])}}return!1}(c,t);!1!==i&&(c=c.replace("&"+t+"="+i,"")),c+="&"+t+"="+e,window.location.replace(c)}),r(document).on("click",".cmplz-tablinks",function(){r(".cmplz-tablinks").removeClass("active"),r(this).addClass("active"),r(".cmplz-tabcontent").removeClass("active"),r("#"+r(this).data("tab")).addClass("active"),r("input[name=cmplz_active_tab]").val(r(this).data("tab"))}),window.setTimeout(function(){r(".cmplz-hide").fadeTo(500,0).slideUp(500,function(){r(this).remove()})},2e3),r(document).on("click",".cmplz-help-modal span",function(e){r(this).closest(".cmplz-help-modal").fadeOut()}),r(".cmplz-radio-container").keypress(function(e){"13"==(e.keyCode||e.which)&&r(e.target).find(":radio").click()}),r(".cmplz-switch, .cmplz-checkbox-container").keypress(function(e){"13"==(e.keyCode||e.which)&&r(e.target).find(":checkbox").click()}),c(),r(document).on("keyup",".multiple-field input[type=text]",function(){c()}),r(document).on("keyup",".multiple-field textarea",function(){c()}),n(),r(":checkbox").change(n),r(document).on("change","input",function(e){a()}),r(document).on("change","select",function(e){a()}),r(document).on("change","textarea",function(e){a()}),r(document).on("cmplzRenderConditions",a);var l=1e4,s=complianz_admin.progress,o=r(".cmplz-progress-bar"),d=r(".detected-cookies");r("#cmplz-scan-progress").length&&(l=3e3),r("#cmplz_cookie_scan_frame").length&&function c(){var e=document.getElementById("cmplz_cookie_scan_frame");e.contentDocument||e.contentWindow.document;d.find(".cmplz-loader").length,e.onload=function(){100<=s||r.get(complianz_admin.admin_url,{action:"cmplz_get_scan_progress"},function(e){var t;e&&(t=(e=jQuery.parseJSON(e)).cookies,r(".detected-cookies .cmplz-cookies-table").html(t.join("<br>")),r(".cmplz-scan-count").html(t.length),s=parseInt(e.progress),t=e.next_page,100<=s?(s=100,o.css({width:s+"%"})):(o.css({width:s+"%"}),r("#cmplz_cookie_scan_frame").attr("src",t),window.setTimeout(c,l)))})}}(),o.css({width:s+"%"});var m=0,p=r(".cmplz-sync-progress-bar"),h=r(".cmplz-sync-status span"),u=r(".cmplz-resync");function v(e){e=void 0!==e&&e,r.get(complianz_admin.admin_url,{action:"cmplz_run_sync",restart:e,nonce:complianz_admin.nonce},function(e){e&&(e=jQuery.parseJSON(e),m=parseInt(e.progress),void 0!==(e=e.message)&&0<e.length&&(r("#cmplz_action_error").removeClass("cmplz-hidden"),r("#cmplz_action_error .cmplz-panel").html(e)),100<=m?(m=100,r("#cmplz-sync-loader").html(""),h.hide(),u.removeAttr("disabled"),y(),p.css({width:m+"%"})):(p.css({width:m+"%"}),window.setTimeout(v,500)))})}h.hide(),r("#cmplz-sync-progress").length?(m=complianz_admin.syncProgress)<100&&(u.attr("disabled","disabled"),h.show(),p.css({width:m+"%"}),v()):r(".cmplz-list-container").length&&y(),r(document).on("click",".cmplz-resync",function(){u.attr("disabled","disabled"),p.css({width:"0%"}),h.show(),v(!0)}),r(document).on("change","input[name=cmplz_show_deleted]",function(){y()}),r(document).on("click",".cmplz-add-to-policy",function(){var e=r(this).closest(".cmplz-slide-panel").find(".cmplz-title").html(),t=r(this).closest(".cmplz-slide-panel").find(".cmplz-panel-content").html(),e=function(e,t){void 0===e&&(e=wpActiveEditor);void 0===t&&(t=e);return jQuery("#wp-"+e+"-wrap").hasClass("tmce-active")&&tinyMCE.get(e)?tinyMCE.get(e).getContent():jQuery("#"+t).val()}("cmplz_custom_privacy_policy_text")+"<h3>"+e+"</h3>"+t,t="cmplz_custom_privacy_policy_text",c=void 0;void 0===t&&(t=wpActiveEditor),void 0===c&&(c=t),jQuery("#wp-"+t+"-wrap").hasClass("tmce-active")&&tinyMCE.get(t)?tinyMCE.get(t).setContent(e):jQuery("#"+c).val(e),r(this).remove()});var z="#bar_pct_all_container";function f(e){var t=e.closest(".cmplz-field");e.is(":checked")?t.find(".cmplz_collectedPersonalData").parent().show():t.find(".cmplz_collectedPersonalData").parent().hide()}function _(e){var t=e.closest(".cmplz-field");e.is(":checked")?t.find(".cmplz_privacyStatementURL").parent().show():t.find(".cmplz_privacyStatementURL").parent().hide()}function g(e){var t,c=!0,e=e.closest(".cmplz-panel");e.find(":input:not(.cmplz_cookieFunction)").each(function(){r(this).is(":checkbox")||r(this).is(":hidden")||"button"===r(this).prop("type")||"SELECT"!==r(this).prop("nodeName")&&0<r(this).val().length||"SELECT"===r(this).prop("nodeName")&&0!=r(this).val()||(c=!1)}),c?((t=e.find(".fa.fa-times")).removeClass("cmplz-error"),t.addClass("cmplz-success"),t.addClass("fa-check"),t.removeClass("fa-times")):((t=e.find(".fa.fa-check")).addClass("cmplz-error"),t.removeClass("cmplz-success"),t.addClass("fa-times"),t.removeClass("fa-check"))}function b(){r(".cmplz-select2").select2({tags:!0,width:"400px"}),r(".cmplz-select2-no-additions").select2({width:"400px"})}function y(){var e=r("#cmplz_language").val(),t=r("input[name=cmplz_show_deleted]").is(":checked"),c=(r(".cmplz-list-container").html('<div class="cmplz-skeleton"></div>'),r("#cmplz_language").data("type"));r.ajax({type:"GET",url:complianz_admin.admin_url,dataType:"json",data:{language:e,action:"cmplz_get_list",deleted:t,type:c},success:function(e){e.success&&(r(".cmplz-list-container").html(e.html),r(".cmplz_isPersonalData").each(function(){f(r(this))}),r(".cmplz_thirdParty").each(function(){_(r(this))}),k(),b())}})}function k(){r(".cmplz-panel").each(function(){r(this).hasClass("cmplz-deleted")?(r(this).find('button[data-action="restore"]').show(),r(this).find('button[data-action="delete"]').hide()):(r(this).find('button[data-action="restore"]').hide(),r(this).find('button[data-action="delete"]').show())})}r(z).show(),r(document).on("change","select[name=cmplz_region]",function(){r(z).hide();var e=r("select[name=cmplz_region]").val(),t=r("select[name=stats_type]").val();r(z="#bar_"+t+"_"+e+"_container").fadeIn()}),r(document).on("change","select[name=stats_type]",function(){r(z).hide();var e="eu",t=(r("select[name=cmplz_region]").length&&(e=r("select[name=cmplz_region]").val()),r("select[name=stats_type]").val());r(z="#bar_"+t+"_"+e+"_container").fadeIn()}),r(document).on("change",".cmplz_isPersonalData",function(){f(r(this))}),r(document).on("change",".cmplz_thirdParty",function(){_(r(this))}),r(document).on("change",".cmplz_sync",function(){var e=r(this).closest(".cmplz-field"),t=r(this),c=!1;t.is(":checked")&&(c=!0),e.find(":input").each(function(){"cmplz_remove_item"!==r(this).attr("name")&&"cmplz-save-item"!==r(this).attr("name")&&"cmplz_restore_item"!==r(this).attr("name")&&"cmplz_showOnPolicy"!==r(this).attr("name")&&"cmplz_sync"!==r(this).attr("name")&&(r(this).prop("disabled",c),c?(r(this).closest(".cmplz-service-field div, .cmplz-cookie-field div").addClass("cmplz-disabled"),r(this).closest("label").addClass("cmplz-disabled")):(r(this).closest(".cmplz-service-field div, .cmplz-cookie-field div").removeClass("cmplz-disabled"),r(this).closest("label").removeClass("cmplz-disabled")))})}),r(document).on("change",".cmplz_use_cdb_api",function(){var t="no"===r(this).val();r(".cmplz-list-container").find(":input[name=cmplz_sync]").each(function(){var e=r(this).closest("label");t?(e.find(":checkbox").prop("checked",!1).change(),e.addClass("cmplz-disabled")):(e.removeClass("cmplz-disabled"),e.find(":checkbox").prop("checked",!0).change())})}),r(document).on("change",".cmplz_sync",function(){var e=r(this).closest(".cmplz-panel");r(this).is(":checked")?e.find(".fa-sync-alt").removeClass("cmplz-disabled"):e.find(".fa-sync-alt").addClass("cmplz-disabled")}),r(document).on("change",".cmplz_showOnPolicy",function(){var e=r(this).closest(".cmplz-panel");r(this).is(":checked")?e.find(".fa-file").removeClass("cmplz-error"):e.find(".fa-file").addClass("cmplz-error")}),r(document).on("keyup",".cmplz-panel input",function(){g(r(this))}),r(document).on("change",".cmplz-panel select",function(){g(r(this))}),r("#cmplz_language").length&&(100==(m=complianz_admin.syncProgress)&&y(),r(document).on("change","#cmplz_language",function(){r(".cmplz-list-container").html('<div class="cmplz-skeleton"></div>'),y()})),r(".cmplz-select2").length&&b(),r(document).on("click",".cmplz-edit-item",function(){var n=r(this).data("action"),a=r(this),e=a.data("type"),l=r(this).closest(".cmplz-"+e+"-field"),s=r(this).closest(".cmplz-panel.cmplz-slide-panel"),t=r("#cmplz_language").val(),o=a.html(),c=(a.html('<div class="cmplz-loader"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>'),l.data(e+"_id")),i={};l.find(":input").each(function(){"button"!==r(this).attr("type")&&("checkbox"===r(this).attr("type")?i[r(this).attr("name")]=r(this).is(":checked"):i[r(this).attr("name")]=r(this).val())}),"delete"===n&&s.addClass("cmplz-deleted"),r.ajax({type:"POST",url:complianz_admin.admin_url,dataType:"json",data:{item_id:c,type:e,data:JSON.stringify(i),cmplz_action:n,language:t,action:"cmplz_edit_item",nonce:complianz_admin.nonce},success:function(e){var t,c,i;e.success&&("delete"===n&&s.remove(),"restore"===n&&(s.removeClass("cmplz-deleted"),l.find("input").each(function(){r(this).removeAttr("disabled")}),l.find("select").each(function(){r(this).removeAttr("disabled")}),l.children("div").removeClass("cmplz-disabled"),l.children("label").removeClass("cmplz-disabled"),l.find('button[name="cmplz-save-item"]').removeAttr("disabled"),l.find(".cmplz_sync").change()),k(),"add"===n&&(t=e.html,i=a.closest(".cmplz-field"),c=r(".cmplz-service-divider.no-service"),e.divider?((c.length?c.closest(".cmplz-service-cookie-list"):(t='<div class="cmplz-service-cookie-list">'+e.divider+t+"<div>",i.find(".cmplz-list-container"))).append(t),c=r(".cmplz-service-divider.no-service"),"no"==r(".cmplz_use_cdb_api:checked").val()&&c.siblings(":last").find(".cmplz_sync").closest("label").addClass("cmplz-disabled")):i.find(".cmplz-list-container").append(t)),"save"===n&&(e=s.find(".cmplz-title"),c=l.find(".cmplz_name").val(),i=e.text().replace(/\".*\"/,'"'+c+'"'),e.text(i)),a.html(o),b())}})}),r(document).on("click",".cmplz_script_add",function(){var t=r(this),c=t.html(),e=t.data("type");t.html('<div class="cmplz-loader"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>'),r.ajax({type:"POST",url:complianz_admin.admin_url,data:{action:"cmplz_script_add",type:e,nonce:complianz_admin.nonce},success:function(e){e.success&&(t.before(e.html),t.html(c))}})}),r(document).on("click",".cmplz_add_url",function(){var e=r(this).closest("div"),t=r(".cmplz-url-template").get(0).innerHTML;e.append(t)}),r(document).on("click",".cmplz_remove_url",function(){r(this).closest("div").remove()}),r(document).on("click",".cmplz_script_save",function(){var t=r(this),c=t.html(),i=t.closest(".cmplz-panel"),e=t.data("type"),n=t.data("action"),a=t.data("id");"save"!=n&&"remove"!=n||t.html('<div class="cmplz-loader"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>');var l={};i.find(":input").each(function(){if("button"!==r(this).attr("type")&&void 0!==r(this).attr("name")&&r(this).data("name"))if("checkbox"===r(this).attr("type"))l[r(this).data("name")]=r(this).is(":checked");else if("radio"===r(this).attr("type"))r(this).is(":checked")&&(l[r(this).data("name")]=r(this).val());else if("urls"===r(this).data("name")){let e=l[r(this).data("name")];(e=void 0===e?[]:e).push(r(this).val()),l[r(this).data("name")]=e}else if("dependency"===r(this).data("name")){let e=l[r(this).data("name")];(e=void 0===e?[]:e).push(r(this).data("url")+"|:|"+r(this).val()),l[r(this).data("name")]=e}else l[r(this).data("name")]=r(this).val()}),r.ajax({type:"POST",url:complianz_admin.admin_url,data:{action:"cmplz_script_save","cmplz-save":!0,type:e,button_action:n,id:a,nonce:complianz_admin.nonce,data:JSON.stringify(l)},success:function(e){e.success&&("save"===n&&t.html(c),"remove"===n)&&(i.remove(),t.html(c))}})}),function(){if(r("#cmplz_anonymous_window_warning").length){var e=window.RequestFileSystem||window.webkitRequestFileSystem;if(!e)return;e(window.TEMPORARY,100,function(e){},function(e){r("#cmplz_anonymous_window_warning").show()})}r("#cmplz_adblock_warning").length&&void 0===window.canRunAds&&r("#cmplz_adblock_warning").show()}(),r(document).on("change",".cmplz-document-input",function(){r(".cmplz-document-field").length&&r(".cmplz-document-field").each(function(){var e=r(this).data("fieldname"),e=r("input[name="+e+"]:checked").val(),t=r(this).find(".cmplz-document-custom-url"),c=r(this).find(".cmplz-document-custom-page");"custom"===e?(c.show(),c.prop("required",!0)):(c.hide(),c.prop("required",!1)),"url"===e?(t.show(),t.prop("required",!0)):(t.hide(),t.prop("required",!1))})}),r(document).on("click","#cmplz-create_pages",function(){var t=r("#cmplz-create_pages"),c=(t.attr("disabled","disabled"),t.html()),i=(t.html('<div class="cmplz-loader "><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>'),{});r(".cmplz-create-page-title").each(function(){var e=i.hasOwnProperty(r(this).data("region"))?i[r(this).data("region")]:{};e[r(this).attr("name")]=r(this).val(),i[r(this).data("region")]=e}),r.ajax({type:"POST",url:complianz_admin.admin_url,dataType:"json",data:{pages:JSON.stringify(i),action:"cmplz_create_pages",nonce:complianz_admin.nonce},success:function(e){e.success?(r(".cmplz-panel.cmplz-notification.cmplz-success.cmplz-hidden").removeClass("cmplz-hidden"),r(".cmplz-create-page-title").each(function(){r(this).removeClass("cmplz-deleted-page").addClass("cmplz-valid-page"),r(this).parent().find(".cmplz-icon").replaceWith(e.icon)}),t.html(e.new_button_text),t.removeAttr("disabled")):(t.html(c),r(".cmplz-page-created").removeClass("fa-times").addClass("fa-check"),r(".cmplz-create-page-title").removeClass("cmplz-deleted-page"))}})}),r(document).on("change",".cmplz-region-select",function(){var e=r(".cmplz-document-button").attr("href").slice(0,-2);r(".cmplz-document-button").attr("href",e+r(this).val())});var w=0,C=r(".cmplz_export_roc_to_csv");function x(e,t){setTimeout(function(){(t+=10)<100?(C.html(t+" %"),x(e,t)):C.replaceWith(e)},100)}function q(e){var t=window.location.href.split("?");if(1!=t.length)for(var c,i=t[1].split("&"),n=0;n<i.length;n++)if((c=i[n].split("="))[0]===e)return void 0===c[1]?"":decodeURIComponent(c[1]);return!1}r(document).on("click",".cmplz_export_roc_to_csv",function(e){e.preventDefault(),C.html(w+" %"),C.prop("disabled",!0),function t(){var c=r(".cmplz_export_roc_to_csv");r.ajax({type:"GET",url:complianz_admin.admin_url,dataType:"json",data:{action:"cmplz_export_roc_to_csv",order:q("order"),cmplz_month_select:q("cmplz_month_select"),cmplz_year_select:q("cmplz_year_select"),orderby:q("orderby"),s:q("s")},success:function(e){e.success&&(e.progress<100?(w=e.progress,c.html(w+" %"),t()):x(e.link,w))}})}()}),r(document).on("change",".cmplz-region-select",function(){var e=r(".cmplz-document-button").attr("href").slice(0,-2);r(".cmplz-document-button").attr("href",e+r(this).val())}),r(document).on("click",".upload_button",function(e){e.preventDefault(),r("input[type=file]").click()}),r(document).on("change",':input[name="cmplz-upload-file"]',function(){r(".cmplz-file-chosen").text(r(this).val().split("\\").pop())}),r(document).on("click",".cmplz-image-uploader, .cmplz-logo-preview.cmplz-clickable",function(){var e=r(this),a=e.closest(".cmplz-field"),l=e.closest(".field-group").data("fieldname"),s=wp.media({frame:"post",state:"insert",multiple:!1});s.on("insert",function(){for(var e=s.state().get("selection").length,t=s.state().get("selection").models,c=0;c<e;c++){var i=t[c].id,n=!1;(n=(n=(n=(n=t[c].attributes.sizes.cmplz_banner_image)||t[c].attributes.sizes.medium)||t[c].attributes.sizes.thumbnail)||t[c].attributes.sizes.full)&&(n=n.url,a.find(".cmplz-logo-preview img").attr("src",n),r("input[name=cmplz_"+l+"]").val(i),r(".cmplz-cookiebanner .cmplz-logo").html("<img>"),r(".cmplz-cookiebanner .cmplz-logo img").attr("src",n))}}),s.open()})});