From 7f624184ab9ee5c212af369ac21042ef2201da72 Mon Sep 17 00:00:00 2001 From: David Stone Date: Thu, 15 Oct 2026 02:41:36 -0600 Subject: [PATCH 1/2] fix: handle AJAX validation-error responses without premature URL access --- .opencode/opencode-loop/ses_ec1488001ffeyIIqVP7gTUs2xf.json | 4 ++++ dist/wpac-frontend-js.asset.php | 2 +- dist/wpac-frontend-js.js | 2 +- dist/wpac-frontend-wp-ajaxify-comments.asset.php | 2 +- dist/wpac-frontend-wp-ajaxify-comments.js | 2 +- src/js/frontend/wp-ajaxify-comments.js | 1 - 6 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 .opencode/opencode-loop/ses_ec1488001ffeyIIqVP7gTUs2xf.json diff --git a/.opencode/opencode-loop/ses_ec1488001ffeyIIqVP7gTUs2xf.json b/.opencode/opencode-loop/ses_ec1488001ffeyIIqVP7gTUs2xf.json new file mode 100644 index 0000000..f507810 --- /dev/null +++ b/.opencode/opencode-loop/ses_ec1488001ffeyIIqVP7gTUs2xf.json @@ -0,0 +1,4 @@ +{ + "version": 4, + "jobs": [] +} \ No newline at end of file diff --git a/dist/wpac-frontend-js.asset.php b/dist/wpac-frontend-js.asset.php index 3c01f77..1d169b9 100644 --- a/dist/wpac-frontend-js.asset.php +++ b/dist/wpac-frontend-js.asset.php @@ -1 +1 @@ - array('jquery'), 'version' => 'ccbce6526e88ce5fe613'); + array('jquery'), 'version' => '101edd886240b9e563aa'); diff --git a/dist/wpac-frontend-js.js b/dist/wpac-frontend-js.js index 5267bfc..af87622 100644 --- a/dist/wpac-frontend-js.js +++ b/dist/wpac-frontend-js.js @@ -1,2 +1,2 @@ /*! For license information please see wpac-frontend-js.js.LICENSE.txt */ -(()=>{var e={8340(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t;(t=jQuery).idleTimer=function(o,n){var r;"object"===e(o)?(r=o,o=null):"number"==typeof o&&(r={timeout:o},o=null),n=n||document,r=t.extend({idle:!1,timeout:3e4,events:"mousemove keydown wheel DOMMouseScroll mousewheel mousedown touchstart touchmove MSPointerDown MSPointerMove"},r);var i=t(n),s=i.data("idleTimerObj")||{},a=function(e){var o=t.data(n,"idleTimerObj")||{};o.idle=!o.idle,o.olddate=+new Date;var r=t.Event((o.idle?"idle":"active")+".idleTimer");t(n).trigger(r,[n,t.extend({},o),e])},l=function(e){var o=t.data(n,"idleTimerObj")||{};if(("storage"!==e.type||e.originalEvent.key===o.timerSyncId)&&null==o.remaining){if("mousemove"===e.type){if(e.pageX===o.pageX&&e.pageY===o.pageY)return;if(void 0===e.pageX&&void 0===e.pageY)return;if(+new Date-o.olddate<200)return}clearTimeout(o.tId),o.idle&&a(e),o.lastActive=+new Date,o.pageX=e.pageX,o.pageY=e.pageY,"storage"!==e.type&&o.timerSyncId&&"undefined"!=typeof localStorage&&localStorage.setItem(o.timerSyncId,o.lastActive),o.tId=setTimeout(a,o.timeout)}},c=function(){var e=t.data(n,"idleTimerObj")||{};e.idle=e.idleBackup,e.olddate=+new Date,e.lastActive=e.olddate,e.remaining=null,clearTimeout(e.tId),e.idle||(e.tId=setTimeout(a,e.timeout))};if(null===o&&void 0!==s.idle)return c(),i;if(null===o);else{if(null!==o&&void 0===s.idle)return!1;if("destroy"===o)return function(){var e=t.data(n,"idleTimerObj")||{};clearTimeout(e.tId),i.removeData("idleTimerObj"),i.off("._idleTimer")}(),i;if("pause"===o)return function(){var e=t.data(n,"idleTimerObj")||{};null==e.remaining&&(e.remaining=e.timeout-(+new Date-e.olddate),clearTimeout(e.tId))}(),i;if("resume"===o)return function(){var e=t.data(n,"idleTimerObj")||{};null!=e.remaining&&(e.idle||(e.tId=setTimeout(a,e.remaining)),e.remaining=null)}(),i;if("reset"===o)return c(),i;if("getRemainingTime"===o)return function(){var e=t.data(n,"idleTimerObj")||{};if(e.idle)return 0;if(null!=e.remaining)return e.remaining;var o=e.timeout-(+new Date-e.lastActive);return o<0&&(o=0),o}();if("getElapsedTime"===o)return+new Date-s.olddate;if("getLastActiveTime"===o)return s.lastActive;if("isIdle"===o)return s.idle}return i.on((r.events+" ").split(" ").join("._idleTimer ").trim(),function(e){l(e)}),r.timerSyncId&&t(window).on("storage",l),(s=t.extend({},{olddate:+new Date,lastActive:+new Date,idle:r.idle,idleBackup:r.idle,timeout:r.timeout,remaining:null,timerSyncId:r.timerSyncId,tId:null,pageX:null,pageY:null})).idle||(s.tId=setTimeout(a,s.timeout)),t.data(n,"idleTimerObj",s),i},t.fn.idleTimer=function(e){return this[0]?t.idleTimer(e,this[0]):this}},281(e,t,o){var n,r,i;!function(){"use strict";function s(e){e.fn._fadeIn=e.fn.fadeIn;var t=e.noop||function(){},o=/MSIE/.test(navigator.userAgent),n=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),r=(document.documentMode,e.isFunction(document.createElement("div").style.setExpression));e.blockUI=function(e){a(window,e)},e.unblockUI=function(e){l(window,e)},e.growlUI=function(t,o,n,r){var i=e('
');t&&i.append("

"+t+"

"),o&&i.append("

"+o+"

"),void 0===n&&(n=3e3);var s=function(t){t=t||{},e.blockUI({message:i,fadeIn:void 0!==t.fadeIn?t.fadeIn:700,fadeOut:void 0!==t.fadeOut?t.fadeOut:1e3,timeout:void 0!==t.timeout?t.timeout:n,centerY:!1,showOverlay:!1,onUnblock:r,css:e.blockUI.defaults.growlCSS})};s(),i.css("opacity"),i.mouseover(function(){s({fadeIn:0,timeout:3e4});var t=e(".blockMsg");t.stop(),t.fadeTo(300,1)}).mouseout(function(){e(".blockMsg").fadeOut(1e3)})},e.fn.block=function(t){if(this[0]===window)return e.blockUI(t),this;var o=e.extend({},e.blockUI.defaults,t||{});return this.each(function(){var t=e(this);o.ignoreIfBlocked&&t.data("blockUI.isBlocked")||t.unblock({fadeOut:0})}),this.each(function(){"static"==e.css(this,"position")&&(this.style.position="relative",e(this).data("blockUI.static",!0)),this.style.zoom=1,a(this,t)})},e.fn.unblock=function(t){return this[0]===window?(e.unblockUI(t),this):this.each(function(){l(this,t)})},e.blockUI.version=2.7,e.blockUI.defaults={message:"

Please wait...

",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var i=null,s=[];function a(a,c){var d,f,h=a==window,C=c&&void 0!==c.message?c.message:void 0;if(!(c=e.extend({},e.blockUI.defaults,c||{})).ignoreIfBlocked||!e(a).data("blockUI.isBlocked")){if(c.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,c.overlayCSS||{}),d=e.extend({},e.blockUI.defaults.css,c.css||{}),c.onOverlayClick&&(c.overlayCSS.cursor="pointer"),f=e.extend({},e.blockUI.defaults.themedCSS,c.themedCSS||{}),C=void 0===C?c.message:C,h&&i&&l(window,{fadeOut:0}),C&&"string"!=typeof C&&(C.parentNode||C.jquery)){var y=C.jquery?C[0]:C,g={};e(a).data("blockUI.history",g),g.el=y,g.parent=y.parentNode,g.display=y.style.display,g.position=y.style.position,g.parent&&g.parent.removeChild(y)}e(a).data("blockUI.onUnblock",c.onUnblock);var P,A,b,w,v=c.baseZ;P=o||c.forceIframe?e(''):e(''),A=c.theme?e(''):e(''),c.theme&&h?(w='"):c.theme?(w='"):w=h?'':'',b=e(w),C&&(c.theme?(b.css(f),b.addClass("ui-widget-content")):b.css(d)),c.theme||A.css(c.overlayCSS),A.css("position",h?"fixed":"absolute"),(o||c.forceIframe)&&P.css("opacity",0);var W=[P,A,b],_=e(h?"body":a);e.each(W,function(){this.appendTo(_)}),c.theme&&c.draggable&&e.fn.draggable&&b.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var k=r&&(!e.support.boxModel||e("object,embed",h?null:a).length>0);if(n||k){if(h&&c.allowBodyStretch&&e.support.boxModel&&e("html,body").css("height","100%"),(n||!e.support.boxModel)&&!h)var S=m(a,"borderTopWidth"),I=m(a,"borderLeftWidth"),x=S?"(0 - "+S+")":0,O=I?"(0 - "+I+")":0;e.each(W,function(e,t){var o=t[0].style;if(o.position="absolute",e<2)h?o.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+c.quirksmodeOffsetHack+') + "px"'):o.setExpression("height",'this.parentNode.offsetHeight + "px"'),h?o.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):o.setExpression("width",'this.parentNode.offsetWidth + "px"'),O&&o.setExpression("left",O),x&&o.setExpression("top",x);else if(c.centerY)h&&o.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),o.marginTop=0;else if(!c.centerY&&h){var n="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+(c.css&&c.css.top?parseInt(c.css.top,10):0)+') + "px"';o.setExpression("top",n)}})}if(C&&(c.theme?b.find(".ui-widget-content").append(C):b.append(C),(C.jquery||C.nodeType)&&e(C).show()),(o||c.forceIframe)&&c.showOverlay&&P.show(),c.fadeIn){var U=c.onBlock?c.onBlock:t,T=c.showOverlay&&!C?U:t,j=C?U:t;c.showOverlay&&A._fadeIn(c.fadeIn,T),C&&b._fadeIn(c.fadeIn,j)}else c.showOverlay&&A.show(),C&&b.show(),c.onBlock&&c.onBlock.bind(b)();if(u(1,a,c),h?(i=b[0],s=e(c.focusableElements,i),c.focusInput&&setTimeout(p,20)):function(e,t,o){var n=e.parentNode,r=e.style,i=(n.offsetWidth-e.offsetWidth)/2-m(n,"borderLeftWidth"),s=(n.offsetHeight-e.offsetHeight)/2-m(n,"borderTopWidth");t&&(r.left=i>0?i+"px":"0"),o&&(r.top=s>0?s+"px":"0")}(b[0],c.centerX,c.centerY),c.timeout){var D=setTimeout(function(){h?e.unblockUI(c):e(a).unblock(c)},c.timeout);e(a).data("blockUI.timeout",D)}}}function l(t,o){var n,r,a=t==window,l=e(t),d=l.data("blockUI.history"),p=l.data("blockUI.timeout");p&&(clearTimeout(p),l.removeData("blockUI.timeout")),o=e.extend({},e.blockUI.defaults,o||{}),u(0,t,o),null===o.onUnblock&&(o.onUnblock=l.data("blockUI.onUnblock"),l.removeData("blockUI.onUnblock")),r=a?e("body").children().filter(".blockUI").add("body > .blockUI"):l.find(">.blockUI"),o.cursorReset&&(r.length>1&&(r[1].style.cursor=o.cursorReset),r.length>2&&(r[2].style.cursor=o.cursorReset)),a&&(i=s=null),o.fadeOut?(n=r.length,r.stop().fadeOut(o.fadeOut,function(){0===--n&&c(r,d,o,t)})):c(r,d,o,t)}function c(t,o,n,r){var i=e(r);if(!i.data("blockUI.isBlocked")){t.each(function(e,t){this.parentNode&&this.parentNode.removeChild(this)}),o&&o.el&&(o.el.style.display=o.display,o.el.style.position=o.position,o.el.style.cursor="default",o.parent&&o.parent.appendChild(o.el),i.removeData("blockUI.history")),i.data("blockUI.static")&&i.css("position","static"),"function"==typeof n.onUnblock&&n.onUnblock(r,n);var s=e(document.body),a=s.width(),l=s[0].style.width;s.width(a-1).width(a),s[0].style.width=l}}function u(t,o,n){var r=o==window,s=e(o);if((t||(!r||i)&&(r||s.data("blockUI.isBlocked")))&&(s.data("blockUI.isBlocked",t),r&&n.bindEvents&&(!t||n.showOverlay))){var a="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";t?e(document).bind(a,n,d):e(document).unbind(a,d)}}function d(t){if("keydown"===t.type&&t.keyCode&&9==t.keyCode&&i&&t.data.constrainTabKey){var o=s,n=!t.shiftKey&&t.target===o[o.length-1],r=t.shiftKey&&t.target===o[0];if(n||r)return setTimeout(function(){p(r)},10),!1}var a=t.data,l=e(t.target);return l.hasClass("blockOverlay")&&a.onOverlayClick&&a.onOverlayClick(t),l.parents("div."+a.blockMsgClass).length>0||0===l.parents().children().filter("div.blockUI").length}function p(e){if(s){var t=s[!0===e?s.length-1:0];t&&t.focus()}}function m(t,o){return parseInt(e.css(t,o),10)||0}}o.amdO.jQuery?(r=[o(428)],void 0===(i="function"==typeof(n=s)?n.apply(t,r):n)||(e.exports=i)):s(jQuery)}()},9166(){!function(){"use strict";var e=0,t={};function o(n){if(!n)throw new Error("No options passed to Waypoint constructor");if(!n.element)throw new Error("No element option passed to Waypoint constructor");if(!n.handler)throw console.log("options",n),new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=o.Adapter.extend({},o.defaults,n),this.element=this.options.element,this.adapter=new o.Adapter(this.element),this.callback=n.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=o.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=o.Context.findOrCreateByElement(this.options.context),o.offsetAliases[this.options.offset]&&(this.options.offset=o.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),t[this.key]=this,e+=1}o.prototype.queueTrigger=function(e){this.group.queueTrigger(this,e)},o.prototype.trigger=function(e){this.enabled&&this.callback&&this.callback.apply(this,e)},o.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete t[this.key]},o.prototype.disable=function(){return this.enabled=!1,this},o.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},o.prototype.next=function(){return this.group.next(this)},o.prototype.previous=function(){return this.group.previous(this)},o.invokeAll=function(e){var o=[];for(var n in t)o.push(t[n]);for(var r=0,i=o.length;rn.oldScroll?n.forward:n.backward;for(var i in this.waypoints[o]){var s=this.waypoints[o][i];if(null!==s.triggerPoint){var a=n.oldScroll=s.triggerPoint;(a&&l||!a&&!l)&&(s.queueTrigger(r),e[s.group.id]=s.group)}}}for(var c in e)e[c].flushTriggers();this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}},i.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},i.prototype.remove=function(e){delete this.waypoints[e.axis][e.key],this.checkEmpty()},i.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},i.prototype.destroy=function(){var e=[];for(var t in this.waypoints)for(var o in this.waypoints[t])e.push(this.waypoints[t][o]);for(var n=0,r=e.length;n-1&&(m=Math.ceil(s.contextDimension*m/100))),l=s.contextScroll-s.contextOffset,p.triggerPoint=Math.floor(h+l-m),c=f=s.oldScroll,d=!c&&!u,!C&&c&&u?(p.queueTrigger(s.backward),r[p.group.id]=p.group):(!C&&d||C&&s.oldScroll>=p.triggerPoint)&&(p.queueTrigger(s.forward),r[p.group.id]=p.group)}}return n.requestAnimationFrame(function(){for(var e in r)r[e].flushTriggers()}),this},i.findOrCreateByElement=function(e){return i.findByElement(e)||new i(e)},i.refreshAll=function(){for(var e in o)o[e].refresh()},i.findByElement=function(e){return o[e.waypointContextKey]},window.onload=function(){r&&r(),i.refreshAll()},n.requestAnimationFrame=function(t){(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||e).call(window,t)},n.Context=i}(),function(){"use strict";function e(e,t){return e.triggerPoint-t.triggerPoint}function t(e,t){return t.triggerPoint-e.triggerPoint}var o={vertical:{},horizontal:{}},n=window.Waypoint;function r(e){this.name=e.name,this.axis=e.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}r.prototype.add=function(e){this.waypoints.push(e)},r.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},r.prototype.flushTriggers=function(){for(var o in this.triggerQueues){var n=this.triggerQueues[o],r="up"===o||"left"===o;n.sort(r?t:e);for(var i=0,s=n.length;i-1&&this.waypoints.splice(t,1)},r.prototype.first=function(){return this.waypoints[0]},r.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},r.findOrCreate=function(e){return o[e.axis][e.name]||new r(e)},n.Group=r}(),function(){"use strict";var e=window.jQuery,t=window.Waypoint;function o(t){this.$element=e(t)}e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,t){o.prototype[t]=function(){var e=Array.prototype.slice.call(arguments);return this.$element[t].apply(this.$element,e)}}),e.each(["extend","inArray","isEmptyObject"],function(t,n){o[n]=e[n]}),t.adapters.push({name:"jquery",Adapter:o}),t.Adapter=o}(),function(){"use strict";var e=window.Waypoint;function t(t){return function(){var o=[],n=arguments[0];return t.isFunction(arguments[0])&&((n=t.extend({},arguments[1])).handler=arguments[0]),this.each(function(){var r=t.extend({},n,{element:this});"string"==typeof r.context&&(r.context=t(this).closest(r.context)[0]),o.push(new e(r))}),o}}window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}()},6247(e,t,o){var n;!function(){var r={starts_with_slashes:/^\/+/,ends_with_slashes:/\/+$/,pluses:/\+/g,query_separator:/[&;]/,uri_parser:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*)(?::([^:@]*))?)?@)?(\[[0-9a-fA-F:.]+\]|[^:\/?#]*)(?::(\d+|(?=:)))?(:)?)((((?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/};function i(e){return e&&(e=e.toString().replace(r.pluses,"%20"),e=decodeURIComponent(e)),e}function s(e){var t,o,n,s,a,l,c,u=[];if(null==e||""===e)return u;for(0===e.indexOf("?")&&(e=e.substring(1)),t=0,c=(o=e.toString().split(r.query_separator)).length;t>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(o=t),n=0;n0&&(r+="&"),null===o[1]?r+=o[0]:(r+=o[0],r+="=",void 0!==o[1]&&(r+=encodeURIComponent(o[1])));return r.length>0?"?"+r:r},a.prototype.getQueryParamValue=function(e){var t,o,n;for(o=0,n=this.queryPairs.length;o0&&this.queryPairs.push([e,t]),this},a.prototype.hasQueryParam=function(e){var t,o=this.queryPairs.length;for(t=0;t=0&&this.deleteQueryParam(e,i(o)).addQueryParam(e,t,s)}else{for(n=0;n]*>([\\s\\S]*)","i"),WPAC._ExtractBody=function(e){try{return jQuery("
"+WPAC._BodyRegex.exec(e)[1]+"
")}catch(e){return!1}},WPAC._TitleRegex=new RegExp("]*>(.*?)<\\/title>","im"),WPAC._ExtractTitle=function(e){try{return WPAC._TitleRegex.exec(e)[1]}catch(e){return!1}},WPAC._ShowMessage=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=WPAC._Options.lazyLoadDisplay;if(!WPAC._Options.lazyLoadEnabled||"overlay"===n||o){var r=WPAC._Options.popupMarginTop+(jQuery("#wpadminbar").outerHeight()||0),i=WPAC._Options.popupBackgroundColorLoading,s=WPAC._Options.popupTextColorLoading;"error"===t?(i=WPAC._Options.popupBackgroundColorError,s=WPAC._Options.popupTextColorError):"success"===t&&(i=WPAC._Options.popupBackgroundColorSuccess,s=WPAC._Options.popupTextColorSuccess);var a="verticalStart"===WPAC._Options.popupVerticalAlign?r+"px":"unset";"verticalCenter"===WPAC._Options.popupVerticalAlign&&(a="45%"),jQuery.blockUI({blockMsgClass:"wpac-overlay",message:e,fadeIn:WPAC._Options.popupFadeIn,fadeOut:WPAC._Options.popupFadeOut,timeout:"loading"===t?0:WPAC._Options.popupTimeout,centerY:!1,centerX:!0,showOverlay:!0,css:{width:"var(--wpac-popup-width)",left:"calc(50% - var(--wpac-popup-width) / 2)",top:a,bottom:"verticalEnd"===WPAC._Options.popupVerticalAlign?r+"px":"unset",border:"none",padding:WPAC._Options.popupPadding+"px",backgroundColor:i,"-webkit-border-radius":WPAC._Options.popupCornerRadius+"px","-moz-border-radius":WPAC._Options.popupCornerRadius+"px","border-radius":WPAC._Options.popupCornerRadius+"px",opacity:WPAC._Options.popupOpacity/100,color:s,textAlign:WPAC._Options.popupTextAlign,cursor:"loading"===t||"loadingPreview"===t?"wait":"default","font-size":WPAC._Options.popupTextFontSize},overlayCSS:{backgroundColor:WPAC._Options.popupOverlayBackgroundColor,opacity:WPAC._Options.popupOverlayBackgroundColorOpacity},baseZ:WPAC._Options.popupZindex})}},WPAC._DebugErrorShown=!1,WPAC._Debug=function(t,o){if(WPAC._Options.debug)if(Function.prototype.call&&Function.prototype.call.bind&&void 0!==window.console&&window.console&&"object"===e(window.console.log)&&void 0===window.console[t].apply&&(window.console[t]=Function.prototype.call.bind(window.console[t],window.console)),void 0!==window.console&&void 0!==window.console[t]&&void 0!==window.console[t].apply){var n=jQuery.merge(["[WP Ajaxify Comments] "+o],jQuery.makeArray(arguments).slice(2));window.console[t].apply(window.console,n)}else WPAC._DebugErrorShown||(0,window.alert)("Unfortunately the console object is undefined or is not supported in your browser, debugging WP Ajaxify Comments is disabled! Please use Firebug, Google Chrome or Internet Explorer 9 or above with enabled Developer Tools (F12) for debugging WP Ajaxify Comments."),WPAC._DebugErrorShown=!0},WPAC._DebugSelector=function(e,t,o){if(WPAC._Options.debug){var n=jQuery(t);n.length?WPAC._Debug("info","Search %s (selector: '%s')... Found: %o",e,t,n):WPAC._Debug(o?"info":"error","Search %s (selector: '%s')... Not found",e,t)}},WPAC._AddQueryParamStringToUrl=function(e,t,o){var n=new URL(e),r=n.searchParams;return r.set(t,o),n.search=r.toString(),n.toString()},WPAC._LoadFallbackUrl=function(e){WPAC._ShowMessage(WPAC._Options.textReloadPage,"loading");var t=WPAC._AddQueryParamStringToUrl(e,"WPACRandom",(new Date).getTime());WPAC._Debug("info","Something went wrong. Reloading page (URL: '%s')...",t);var o=function(){location.href=t};WPAC._Options.debug?(WPAC._Debug("info","Sleep for 5s to enable analyzing debug messages..."),window.setTimeout(o,5e3)):o()},WPAC._ScrollToAnchor=function(e,t,o){o=o||function(){};var n=jQuery(e);if(n.length){WPAC._Debug("info","Scroll to anchor element %o (scroll speed: %s ms)...",n,WPAC._Options.scrollSpeed);var r=function(){t&&(window.location.hash=e),o()},i=n.offset().top;return jQuery(window).scrollTop()===i?r():jQuery("html,body").animate({scrollTop:i},{duration:WPAC._Options.scrollSpeed,complete:r}),!0}return WPAC._Debug("error","Anchor element not found (selector: '%s')",e),!1},WPAC._UpdateUrl=function(e){e.split("#")[0]!==window.location.href.split("#")[0]&&(window.history.replaceState?window.history.replaceState({},window.document.title,e):WPAC._Debug("info","Browser does not support window.history.replaceState() to update the URL without reloading the page"))},WPAC._GetScopedPostId=function(e){if("string"!=typeof e||!e)return 0;var t=e.match(/^\[data-wpac-post-id=["']?(\d+)["']?\]$/);return t?parseInt(t[1],10):0},WPAC._FindFormMarkerByPostId=function(e,t){var o=parseInt(t,10);return e&&e.length&&o?e.find('input[name="comment_post_ID"]').filter(function(){return parseInt(jQuery(this).val(),10)===o}).first():jQuery()},WPAC._FindCommentsContainerByPostId=function(e,t){var o=parseInt(t,10),n=WPAC._Options.selectorCommentsContainer,r=WPAC._FindFormMarkerByPostId(e,o);if(r.length){var i=r.closest(n);if(i.length)return i.first();var s=WPAC._Options.selectorPostContainer;if(s){var a=r.closest(s);if(a.length){var l=a.find(n);if(l.length)return l.first()}}}if(o){var c=e.find("#comments-"+o);if(c.length){var u=c.find(n);if(u.length)return u.first();if(c.is(n))return c.first()}}return jQuery()},WPAC._FindCommentFormByPostId=function(e,t){var o=WPAC._FindFormMarkerByPostId(e,t);if(!o.length)return jQuery();var n=WPAC._Options.selectorCommentForm;if(n){var r=o.closest(n);if(r.length)return r.first()}return o.closest("form")},WPAC._CollectPostIds=function(e){var t=[];return e&&e.length?(e.find('input[name="comment_post_ID"]').each(function(){var e=parseInt(jQuery(this).val(),10);e&&-1===t.indexOf(e)&&t.push(e)}),t):t},WPAC._GetSavedFormFields=function(e,t){return e?e.byPostId?t?e.byPostId[t]:null:Array.isArray(e.fields)?e.fields:Array.isArray(e)?e:null:null},WPAC._GetSavedReplyState=function(e,t){return e?e.replyStateByPostId?t?e.replyStateByPostId[t]:null:e.replyState||null:null},WPAC._CaptureReplyState=function(e,t){if(!e||!e.length)return null;var o=parseInt(e.find('input[name="comment_parent"]').val(),10),n=e.closest(t);if(!o||!n.length)return null;var r=jQuery("#comment-"+o);return{parentId:o,respondId:n.attr("id")||"",targetId:r.attr("id")||"comment-"+o}},WPAC._RestoreReplyState=function(e,t,o){if(e&&e.length&&t&&t.parentId){var n=e.closest(o),r=e.find('input[name="comment_parent"]');if(n.length&&r.length){var i=document.getElementById(t.targetId);if(i)return window.addComment&&"function"==typeof window.addComment.moveForm&&t.respondId?window.addComment.moveForm(t.targetId,r.attr("id")||"comment_parent",t.respondId,t.parentId):(jQuery("#wp-temp-form-div").length||jQuery('
').insertBefore(n),jQuery(i).after(n),n.find("#cancel-comment-reply-link").show()),void r.val(t.parentId);if(window.addComment&&"function"==typeof window.addComment.cancelForm)window.addComment.cancelForm();else{var s=jQuery("#wp-temp-form-div");s.length&&s.replaceWith(n),n.find("#cancel-comment-reply-link").hide()}r.val(0)}}},WPAC._RestoreFormData=function(e,t){e&&e.length&&t&&t.length&&jQuery.each(t,function(t,o){var n=e.find("[name='"+o.name+"']"),r="comment_parent"===o.name&&parseInt(o.value,10)&&0===parseInt(n.val(),10);1!==n.length||n.val()&&!r||n.val(o.value)})},WPAC._ReplaceMultipleComments=function(e,t,o,n,r,i,s,a,l,c){var u=jQuery(document),d=WPAC._GetScopedPostId(i),p=d?[d]:WPAC._CollectPostIds(u);if(!p.length)return WPAC._Debug("error","No comment_post_ID markers found for multiple comment containers"),WPAC._LoadFallbackUrl(o),!1;""!==l&&new Function("extractedBody","commentUrl",l)(e,t);var m=new CustomEvent("wpacBeforeUpdateComments",{detail:{newDom:e,commentUrl:t}});document.dispatchEvent(m);var f=[],h=!1;if(jQuery.each(p,function(t,o){var n=WPAC._FindCommentsContainerByPostId(u,o),r=WPAC._FindCommentsContainerByPostId(e,o);if(!n.length||!r.length)return WPAC._Debug("error","Unable to map comments container for post ID %s (live: %s, fetched: %s)",o,n.length,r.length),void(h=!0);f.push({postId:o,$old:n,$new:r})}),h||f.length!==p.length)return WPAC._LoadFallbackUrl(o),!1;var C=[];if(jQuery.each(f,function(e,t){t.$old.empty(),t.$old.append(t.$new.children()),C.push(t.postId),WPAC._Debug("info","Replaced comments container for post ID %s",t.postId)}),WPAC._Options.commentsEnabled){var y=!1;if(jQuery.each(C,function(t,o){var r=WPAC._FindCommentsContainerByPostId(u,o),i=WPAC._FindCommentFormByPostId(u,o),s=i.length&&r.length&&(jQuery.contains(r[0],i[0])||r[0]===i[0]);if(i.length){if(!s){WPAC._Debug("info","Replace comment form for post ID %s...",o);var l=WPAC._FindCommentFormByPostId(e,o);if(!l.length)return WPAC._Debug("error","Comment form for post ID %s not found in fetched document",o),d?(y=!0,!1):void 0;i.replaceWith(l)}}else if(d){WPAC._Debug("info","Try to re-inject comment form...");var c=jQuery("#wp-temp-form-div");if(!c.length)return WPAC._Debug("error","WordPress' #wp-temp-form-div container not found",a),y=!0,!1;var p=WPAC._FindCommentFormByPostId(e,o),m=p.length?p.closest(a):e.find(a).first();if(!m.length)return WPAC._Debug("error","Respond container on requested page not found (selector: '%s')",a),y=!0,!1;c.replaceWith(m)}var f=WPAC._FindCommentFormByPostId(u,o);WPAC._RestoreFormData(f,WPAC._GetSavedFormFields(n,o)),WPAC._RestoreReplyState(f,WPAC._GetSavedReplyState(n,o),a)}),y)return WPAC._LoadFallbackUrl(o),!1;if(r){var g=n&&n.focusPostId?n.focusPostId:d,P=(g?WPAC._FindCommentFormByPostId(u,g):jQuery(s)).find("[name='"+r+"']");P.length&&P.focus()}}""!==c&&new Function("extractedBody","commentUrl",c)(e,t);var A=new CustomEvent("wpacAfterUpdateComments",{detail:{newDom:e,commentUrl:t}});return document.dispatchEvent(A),!0},WPAC._ReplaceComments=function(e,t,o,n,r,i,s,a,l,c,u){jQuery("#wpac-lazy-load-content-clone").remove();var d=o?WPAC._AddQueryParamStringToUrl(t,"WPACFallback","1"):t,p=WPAC._ExtractBody(e);if(!1===p)return WPAC._Debug("error","Unsupported server response, unable to extract body (data: '%s')",e),WPAC._LoadFallbackUrl(d),!1;""!==l&&new Function("extractedBody",l)(p);var m=new CustomEvent("wpacBeforeSelectElements",{detail:{extractedBody:p}});if(document.dispatchEvent(m),WPAC._Options.hasMultipleCommentContainers)return WPAC._ReplaceMultipleComments(p,t,d,n,r,i,s,a,c,u);var f=jQuery(i);if(WPAC._Options.lazyLoadIntoElement&&"comments"!==WPAC._Options.lazyLoadInlineDisplayLocation&&(f=jQuery(WPAC._Options.lazyLoadInlineDisplayElement)),!f.length)return WPAC._Debug("error","Comment container on current page not found (selector: '%s')",i),WPAC._LoadFallbackUrl(d),!1;f.length>1&&(WPAC._Debug("error","Comment form on requested page found multiple times (selector: '%s')",f),f=(f=f.filter(function(){return jQuery(this).children().length>0&&!jQuery(this).is(":header")})).filter(function(){return 0===jQuery(this).parents().filter(f).length}));var h=p.find(WPAC._Options.selectorCommentsContainer);if(!h.length)return WPAC._Debug("error","Comment container on requested page not found (selector: '%s')",i),WPAC._LoadFallbackUrl(d),!1;if(h.length>1){WPAC._Debug("error","Comment form on requested page found multiple times (selector: '%s')",h);var C=(h=(h=h.filter(function(){return jQuery(this).children().length>0&&!jQuery(this).is(":header")})).filter(function(){return 0===jQuery(this).parents().filter(h).length})).find(a);C.length&&h.length>1&&C.remove()}""!==c&&new Function("extractedBody","commentUrl",c)(p,t);var y=new CustomEvent("wpacBeforeUpdateComments",{detail:{newDom:p,commentUrl:t}});document.dispatchEvent(y);var g=WPAC._ExtractTitle(e);if(!1!==p&&(document.title=jQuery("