/*! IconCaptcha v4.0.2 | (c) 2017-2024, Fabian Wennink (fabianwennink.nl) | fabianwennink.nl/projects/IconCaptcha-Widget/license */ "use strict";function _typeof(e){return(_typeof="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)}var IconCaptchaPolyfills=function(){var e={extend:function(e){e=e||{};for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,r=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){r=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(r)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nleast amount of times",correct:"Verification complete.",incorrect:{title:"Uh oh.",subtitle:"You've selected the wrong image."},timeout:{title:"Please wait.",subtitle:"You made too many incorrect selections."}}},q="https://www.fabianwennink.nl/projects/IconCaptcha",k="IconCaptcha by Fabian Wennink",M=320,E=50;e.$init=function(e,t){return n(this,e,t)},e.init=function(e,t){e=Array.from(document.querySelectorAll(e));return n(this,e,t)},e.reset=function(t){return void 0===this.instances?console.error("IconCaptcha has not yet been initialized. Cannot use 'reset' yet."):a(this.instances,function(e){void 0!==t&&e.id!==t||null!=e&&e.reset()}),this},e.bind=function(t,n){return void 0===this.instances?console.error("IconCaptcha has not yet been initialized. Cannot use 'bind' yet."):a(this.instances,function(e){e.element.addEventListener(t,n)}),this};var n=function(e,t,n){if(void 0===e.instances||!t.some(function(e){return null!==e.querySelector(".iconcaptcha-modal")})){void 0===e.instances&&(e.instances={});var a=IconCaptchaPolyfills.extend({},r,n||{}),o=Object.values(e.instances).length;e.instances[o]=[];for(var i=0;i","
","
","
".concat(i.locale.initialization.verify,"
"),"
",""],t=i.general.showCredits?"":"display: none",e.splice(4,0,""),l.classList.add("iconcaptcha-init"),l.classList.remove("iconcaptcha-error","iconcaptcha-success"),void(l.innerHTML=e.join(""));p||function(){var e=[];e.push("
","
","".concat(i.locale.header,""),"
","
","","
","","
","");for(var n=0,a=["wid","cid","hp"];n"))}e.push("
"),l.innerHTML=e.join(""),r=l.querySelector(".iconcaptcha-modal__body")}(),C(),i.security.loadingAnimationDuration&&0'),n=r.querySelector(".iconcaptcha-modal__body-selection > i"),function(e){for(var t in e._ic_listeners={click:function(e){var t,n,a;new Date-f<=i.security.interactionDelay||i.security.hoverProtection&&!y||(t=IconCaptchaPolyfills.offset(e.currentTarget),n=e.pageX-t.left,a=e.pageY-t.top,n&&a&&(r.classList.contains("captcha-opacity")||(IconCaptchaPolyfills.trigger(l,"selected",{captchaId:c}),i.security.loadingAnimationDuration&&0"),m(),IconCaptchaPolyfills.trigger(l,"refreshed",{captchaId:c})}function _(e,t){void 0!==e&&void 0!==t&&(h=!0,O(),e=Math.round(e),t=Math.round(t),n.style.display="none",t=T({widgetId:c,challengeId:a,action:"SELECTION",x:e,y:t,width:u,token:o}),IconCaptchaPolyfills.ajax({url:i.general.endpoint,type:"POST",headers:L(o),data:{payload:t},success:function(e){e=j(e);e.completed?w(e):I()},error:function(){return A(-1)}}))}function w(e){r.classList.remove("captcha-opacity"),D(l.querySelector(".iconcaptcha-modal__body-selection")),null!=e&&e.expiredAt&&(o=e.expiredAt-Date.now(),d=setTimeout(S,o));var t,n=_createForOfIteratorHelper(l.querySelectorAll(".iconcaptcha-modal__header, .iconcaptcha-modal__footer, .iconcaptcha-modal__body"));try{for(n.s();!(t=n.n()).done;){var a=t.value;a.parentNode.removeChild(a)}}catch(e){n.e(e)}finally{n.f()}l.classList.add("iconcaptcha-success");var e='
'+'
'.concat(i.locale.correct,"
")+'
'.concat('',"
"),o=i.general.showCredits?"":"display: none";e+="",e+="
",l.querySelector(".iconcaptcha-modal").innerHTML+=e,h=!1,IconCaptchaPolyfills.trigger(l,"success",{captchaId:c})}function I(e,t,n){n=!(2'.concat(e,"")+'
'.concat(t,"
"),h=!1,IconCaptchaPolyfills.trigger(l,"error",{captchaId:c}),n&&setTimeout(b,i.security.incorrectSelectionResetDelay)}function C(){r.classList.add("captcha-opacity"),r.insertAdjacentHTML("beforeend",'
')}function S(){a=void 0,s=p=!1,b(),IconCaptchaPolyfills.trigger(l,"invalidated",{captchaId:c})}function O(){null!==d&&(clearTimeout(d),d=null)}function A(e,t){switch(e){case"too-many-attempts":I(i.locale.timeout.title,i.locale.timeout.subtitle,!1);var n=l.querySelector(".iconcaptcha-modal__header");n.parentNode.removeChild(n),IconCaptchaPolyfills.trigger(l,"timeout",{captchaId:c}),setTimeout(S,t);break;case"invalid-form-token":P(!0,"Captcha form token is missing or incorrect.","A server request was made without including a captcha token, however this option is enabled.");break;default:P(!0,"An unexpected error occurred.","An unexpected error occurred while IconCaptcha performed an action.")}}function P(e,t,n){n=2