"use strict";Liferay.Loader.define("@liferay!analytics-settings-web$testing-library/dom@8.20.0/dist/wait-for-element-to-be-removed",["module","exports","require","./wait-for"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.waitForElementToBeRemoved=async function waitForElementToBeRemoved(e,t){const r=new Error("Timed out in waitForElementToBeRemoved.");if("function"!=typeof e){initialCheck(e);const t=(Array.isArray(e)?e:[e]).map((e=>{let t=e.parentElement;if(null===t)return()=>null;for(;t.parentElement;)t=t.parentElement;return()=>t.contains(e)?e:null}));e=()=>t.map((e=>e())).filter(Boolean)}return initialCheck(e()),(0,n.waitFor)((()=>{let t;try{t=e()}catch(e){if("TestingLibraryElementError"===e.name)return;throw e}if(!isRemoved(t))throw r}),t)};var n=r("./wait-for");const isRemoved=e=>!e||Array.isArray(e)&&!e.length;function initialCheck(e){if(isRemoved(e))throw new Error("The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.")}}}));
//# sourceMappingURL=wait-for-element-to-be-removed.js.map