!function(){"use strict";var t=window.ctFrontend;function e(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=function(t){var e,n=new ClipboardEvent("").clipboardData||new DataTransfer,o=function(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=r(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}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,a,i=!0,c=!1;return{s:function(){o=t[Symbol.iterator]()},n:function(){var t=o.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==o.return||o.return()}finally{if(c)throw a}}}}(t);try{for(o.s();!(e=o.n()).done;){var a=e.value;n.items.add(a)}}catch(t){o.e(t)}finally{o.f()}return n.files},a=[];(0,t.registerDynamicChunk)("blocksy_ext_woo_extra_advanced_reviews",{mount:function(t,r){var n=r.event,i=t.closest("form");if(i){i.enctype="multipart/form-data";var c=t.files,l=document.querySelector(".ct-review-upload-actions");l.querySelectorAll(".ct-media-container").forEach((function(t){t.remove()}));var u=n.bubbles?[].concat(e(a),e(Array.from(c))):a;a=u,t.files=o(u),u.length>0&&u.forEach((function(e,r){var n=URL.createObjectURL(e),i=document.createElement("figure");i.classList.add("ct-media-container"),i.innerHTML='\n\t\t\t\t\t<img src="'.concat(n,'" style="aspect-ratio: 1/1" alt="Review Image">\n\t\t\t\t\t<span class="ct-remove-image">\n\t\t\t\t\t\t<svg width="10" height="10" viewBox="0 0 15 15" fill="currentColor">\n\t\t\t\t\t\t\t<path d="M8.5,7.5l4.5,4.5l-1,1L7.5,8.5L3,13l-1-1l4.5-4.5L2,3l1-1l4.5,4.5L12,2l1,1L8.5,7.5z"></path>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</span>\n\t\t\t\t'),l.insertBefore(i,l.querySelector('[for="blc-review-images"]')),i.querySelector(".ct-remove-image").addEventListener("click",(function(){i.remove();var e=u.filter((function(t,e){return e!==r}));t.files=o(e),a=e,t.dispatchEvent(new Event("change"))}))}))}}})}();