(()=>{"use strict";class e{constructor(e){this.form=e,this.form}isScreen(e,t){return t.indexOf("gf_entry_")>-1}place(){var e;let t=document.querySelector(".acp-smartfilters");if(t){this.form.addSearch(t),null===(e=AC_SERVICES.getService("Search"))||void 0===e||e.setForm(this.form.getElement());const r=AC_SERVICES.getService("ResetFilters");this.form.getElement().querySelectorAll(".acs-form__clear").forEach(e=>{e.append(r.getElement())}),this.form.place()}}}acp_table&&(acp_table.column_sets_style="dropdown"),document.addEventListener("DOMContentLoaded",()=>{let e=document.querySelector("#gf_form_toolbar");e&&e.insertAdjacentHTML("afterend",'<div class="wp-header-end"></div>')}),AC_SERVICES.addListener("Table.Ready",()=>{const e=document.querySelector(".acp-layout-switcher"),t=document.querySelector(".gform-form-toolbar__container #gform-form-toolbar__menu");e&&t&&t.parentElement.insertBefore(e,t)}),AC_SERVICES.addListener("Service.Registered.LayoutTabs",e=>{if("tabs"===e.getStyle()){const t=e.getElement(),r=document.querySelector("#gf-admin-notices-wrapper");r&&t&&t.insertSelfBefore(r)}});const t=new class{constructor(){this.form=AC_SERVICES.$.create("form").setAttribute("id","gf-acs-form"),this.search=AC_SERVICES.$.create("div").addClass("acs-form__search"),this.filtering=AC_SERVICES.$.create("div").addClass("acs-form__filtering"),this.button=AC_SERVICES.$.create("div").addClass("acs-form__button"),this.clear=AC_SERVICES.$.create("div").addClass("acs-form__clear"),this.form.append(this.search.getElement()).append(this.filtering.getElement()).append(this.button.getElement()).append(this.clear.getElement()),this.prepareHiddenFields()}prepareHiddenFields(){["page","id"].forEach(e=>{let t=new URLSearchParams(window.location.search).get(e);t&&this.form.getElement().insertAdjacentHTML("afterbegin",`<input type="hidden" name="${e}" value="${t}">`)})}getElement(){return this.form.getElement()}addSearch(e){this.search.append(e)}addFilter(e){this.filtering.append(e)}placeButton(){0===this.button.getElement().children.length&&this.button.append(AC_SERVICES.$.create("button").addClass("button").addHtml("Filter").getElement())}place(){let e=document.querySelector(".gform-settings__content");e.parentElement.insertBefore(this.form.getElement(),e),this.placeButton()}};AC_SERVICES.addListener("Service.Registered.Filtering",()=>{document.querySelectorAll("#wpbody-content .acp-filter-container")&&(document.querySelectorAll("#wpbody-content .acp-filter-container").forEach(e=>{t.addFilter(e)}),t.place())}),AC_SERVICES.addListener("Search.PlacementFactory",r=>{r.register(new e(t))})})();