(()=>{"use strict";const e=window.wp.i18n,t=e=>"#"===e[0]?document.getElementById(e.slice(1)):document.querySelectorAll(e),n=t("#tables-export"),s=t("#tables-export-zip-file");if(window?.navigator?.platform?.includes("Mac")){const n=t("#tables-export-shortcut-description");n&&(n.textContent=(0,e.sprintf)((0,e.__)("You can select multiple tables by holding down the “%1$s” key or the “%2$s” key for ranges.","tablepress"),(0,e._x)("⌘","keyboard shortcut modifier key on a Mac keyboard","tablepress"),(0,e._x)("Shift","keyboard key","tablepress")))}document.querySelector("#tablepress-page form").addEventListener("submit",(function(e){const i=[...n.selectedOptions].map((e=>e.value));0!==i.length?(t("#tables-export-list").value=i.join(),s.disabled=!1):e.preventDefault()}));const i=t("#tables-export-format");i.addEventListener("change",(function(){const e="csv"!==this.value;t("#tables-export-csv-delimiter").disabled=e,t("#tables-export-csv-delimiter-description").style.display=e?"inline":"none"})),i.dispatchEvent(new Event("change"));let o=!1;s.addEventListener("change",(function(){o=this.checked}));const c=t("#tables-export-select-all");n.addEventListener("change",(function(){const e=n.selectedOptions.length>1;s.disabled=e,s.checked=e||o,t("#tables-export-zip-file-description").style.display=e?"inline":"none",c.checked=n.options.length===n.selectedOptions.length})),n.dispatchEvent(new Event("change")),c.addEventListener("change",(function(){[...n.options].forEach((e=>e.selected=this.checked)),n.dispatchEvent(new Event("change"))}))})();